]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Replace single character strings 5083/head
authorDaniel Arndt <daniel.arndt@iwr.uni-heidelberg.de>
Thu, 14 Sep 2017 13:36:17 +0000 (15:36 +0200)
committerDaniel Arndt <daniel.arndt@iwr.uni-heidelberg.de>
Thu, 14 Sep 2017 13:44:01 +0000 (15:44 +0200)
source/base/job_identifier.cc
source/base/parameter_handler.cc
source/base/patterns.cc
source/base/timer.cc
source/base/utilities.cc
source/grid/grid_in.cc

index 13df1dd755412893fe5698bb4d5928fd4def5ccc..38abaca93558240fea5193e2ae2b876b38e24ce3 100644 (file)
@@ -54,9 +54,9 @@ std::string
 JobIdentifier::base_name(const char *filename)
 {
   std::string name(filename);
-  std::string::size_type pos = name.find(".");
+  std::string::size_type pos = name.find('.');
   name.erase(pos, name.size());
-  pos = name.rfind("/");
+  pos = name.rfind('/');
   if (pos < name.size())
     name.erase(0,pos);
   return name;
index 55c45e49abfd4aec0e9df8585349a0e1d0627da6..13dbeb6e98b0e2c3d9dcb69b8ac826dc8790968b 100644 (file)
@@ -1901,7 +1901,7 @@ ParameterHandler::scan_line (std::string         line,
 
   // if there is a comment, delete it
   if (line.find('#') != std::string::npos)
-    line.erase (line.find("#"), std::string::npos);
+    line.erase (line.find('#'), std::string::npos);
 
   // replace \t by space:
   while (line.find('\t') != std::string::npos)
@@ -1958,7 +1958,7 @@ ParameterHandler::scan_line (std::string         line,
       // erase "set" statement
       line.erase (0, 4);
 
-      std::string::size_type pos = line.find("=");
+      std::string::size_type pos = line.find('=');
       AssertThrow (pos != std::string::npos,
                    ExcCannotParseLine (current_line_n,
                                        input_filename,
index 340d5723c2e87b9631952bcdde625947682e43e6..0d9b68bc0eaedcfa963245769b28217a9a0a399a 100644 (file)
@@ -955,7 +955,7 @@ namespace Patterns
 
   MultipleSelection::MultipleSelection (const std::string &seq)
   {
-    Assert (seq.find (",") == std::string::npos, ExcCommasNotAllowed(seq.find(",")));
+    Assert (seq.find (',') == std::string::npos, ExcCommasNotAllowed(seq.find(',')));
 
     sequence = seq;
     while (sequence.find(" |") != std::string::npos)
@@ -977,10 +977,10 @@ namespace Patterns
         std::string name;
         name = tmp;
 
-        if (name.find(",") != std::string::npos)
+        if (name.find(',') != std::string::npos)
           {
-            name.erase (name.find(","), std::string::npos);
-            tmp.erase (0, tmp.find(",")+1);
+            name.erase (name.find(','), std::string::npos);
+            tmp.erase (0, tmp.find(',')+1);
           }
         else
           tmp = "";
index fe1a58ac9442c4fb16a4a9366da5de0f7f24a496..15099ee4b0a41e05844429f68359042e8a5744c4 100644 (file)
@@ -546,7 +546,7 @@ TimerOutput::print_summary () const
 
           // resize the array so that it is always
           // of the same size
-          unsigned int pos_non_space = name_out.find_first_not_of (" ");
+          unsigned int pos_non_space = name_out.find_first_not_of (' ');
           name_out.erase(0, pos_non_space);
           name_out.resize (32, ' ');
           out_stream << std::endl;
@@ -617,7 +617,7 @@ TimerOutput::print_summary () const
 
           // resize the array so that it is always
           // of the same size
-          unsigned int pos_non_space = name_out.find_first_not_of (" ");
+          unsigned int pos_non_space = name_out.find_first_not_of (' ');
           name_out.erase(0, pos_non_space);
           name_out.resize (32, ' ');
           out_stream << std::endl;
index 9ca6a6e48d93b8535479e5c6cc6c263016146649..983e1519a81e50d7675c5c4890b2d26a1245d57b 100644 (file)
@@ -348,7 +348,7 @@ namespace Utilities
         while ((text.length() != 0) && (text[0] == delimiter))
           text.erase(0, 1);
 
-        std::size_t pos_newline = text.find_first_of("\n", 0);
+        std::size_t pos_newline = text.find_first_of('\n', 0);
         if (pos_newline != std::string::npos && pos_newline <= width)
           {
             std::string line (text, 0, pos_newline);
index fb94862a0e35ae022289adc8c46175f8e65abbaf..4ab71c303fdbce2fb3ae5ee66647d17cde59f282 100644 (file)
@@ -2142,7 +2142,7 @@ void GridIn<dim, spacedim>::parse_tecplot_header(std::string &header,
 
   // now remove whitespace in front of and
   // after '='
-  std::string::size_type pos=header.find("=");
+  std::string::size_type pos=header.find('=');
 
   while (pos!=static_cast<std::string::size_type>(std::string::npos))
     if (header[pos+1]==' ')
@@ -2153,7 +2153,7 @@ void GridIn<dim, spacedim>::parse_tecplot_header(std::string &header,
         --pos;
       }
     else
-      pos=header.find("=",++pos);
+      pos=header.find('=',++pos);
 
   // split the string into individual entries
   std::vector<std::string> entries=Utilities::break_text_into_lines(header,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.