]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Cleanup parts of the code.
authorbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Sun, 25 Aug 2013 05:03:23 +0000 (05:03 +0000)
committerbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Sun, 25 Aug 2013 05:03:23 +0000 (05:03 +0000)
git-svn-id: https://svn.dealii.org/trunk@30474 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/source/base/parameter_handler.cc

index e420fc5d42daa1860901b12f5f4b204241b99867..18c168f742250e45b9bd4968722212401eb2a952 100644 (file)
@@ -1325,8 +1325,7 @@ bool ParameterHandler::read_input (std::istream &input)
     {
       ++lineno;
       getline (input, line);
-      if (!scan_line (line, lineno))
-        status = false;
+      status &= scan_line (line, lineno);
     }
 
   return status;
@@ -1391,8 +1390,7 @@ bool ParameterHandler::read_input_from_string (const char *s)
       input.erase (0, input.find('\n')+1);
       ++lineno;
 
-      if (!scan_line (line, lineno))
-        status = false;
+      status &= scan_line (line, lineno);
     }
 
   return status;
@@ -2293,11 +2291,14 @@ ParameterHandler::scan_line (std::string        line,
     line.erase (line.find("  "), 1);
   // now every existing whitespace
   // should be exactly one ' ';
-  // if at end or beginning: delete
-  if ((line.length() != 0) && (std::isspace (line[0])))  line.erase (0, 1);
+  // if at beginning: delete
+  if ((line.length() != 0) && (std::isspace (line[0])))
+    line.erase (0, 1);
   // if line is now empty: leave
-  if (line.length() == 0) return true;
+  if (line.length() == 0)
+    return true;
 
+  // also delete spaces at the end
   if (std::isspace (line[line.length()-1]))
     line.erase (line.size()-1, 1);
 

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.