From a52e4b4df1a9797b7403fbcfa19f0eb0dc7ac73a Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Tue, 4 Jan 2022 12:56:53 -0700 Subject: [PATCH] Simplify some code. --- source/base/patterns.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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); -- 2.39.5