]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Simplify some code. 13167/head
authorWolfgang Bangerth <bangerth@colostate.edu>
Tue, 4 Jan 2022 19:56:53 +0000 (12:56 -0700)
committerWolfgang Bangerth <bangerth@colostate.edu>
Tue, 4 Jan 2022 19:56:53 +0000 (12:56 -0700)
source/base/patterns.cc

index 1b4fbede05dcde5bf54e7a6ce9cd80fcefaa189f..97deefd890ab71f28a4223e67cf43f87b4974540 100644 (file)
@@ -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);

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.