From: Wolfgang Bangerth Date: Tue, 4 Jan 2022 19:56:53 +0000 (-0700) Subject: Simplify some code. X-Git-Tag: v9.4.0-rc1~668^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F13167%2Fhead;p=dealii.git Simplify some code. --- diff --git a/source/base/patterns.cc b/source/base/patterns.cc index 1b4fbede05..97deefd890 100644 --- a/source/base/patterns.cc +++ b/source/base/patterns.cc @@ -548,7 +548,7 @@ namespace Patterns std::string tmp(sequence); // remove whitespace at beginning - while ((tmp.length() != 0) && ((std::isspace(tmp[0])) != 0)) + while ((tmp.length() != 0) && (std::isspace(tmp.front()) != 0)) tmp.erase(0, 1); // check the different possibilities @@ -561,7 +561,7 @@ namespace Patterns } // remove whitespace at the end - while ((tmp.length() != 0) && ((std::isspace(*(tmp.end() - 1))) != 0)) + while ((tmp.length() != 0) && (std::isspace(tmp.back()) != 0)) tmp.erase(tmp.end() - 1); // check last choice, not finished by | @@ -1272,9 +1272,9 @@ namespace Patterns else tmp = ""; - while ((name.length() != 0) && ((std::isspace(name[0])) != 0)) + while ((name.length() != 0) && (std::isspace(name.front()) != 0)) name.erase(0, 1); - while (std::isspace(name[name.length() - 1]) != 0) + while ((name.length() != 0) && (std::isspace(name.back()) != 0)) name.erase(name.length() - 1, 1); split_names.push_back(name);