]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Do not print unnecessary whitespace 17616/head
authorRene Gassmoeller <rene.gassmoeller@mailbox.org>
Tue, 27 Aug 2024 13:01:29 +0000 (15:01 +0200)
committerRene Gassmoeller <rene.gassmoeller@mailbox.org>
Tue, 27 Aug 2024 13:02:05 +0000 (15:02 +0200)
source/base/parameter_handler.cc

index 189910f9fe086a5a3c2f0818f62bbf412b0f2066..174d9a866be56aa44922b36b4a6d965e377fed50 100644 (file)
@@ -1506,15 +1506,23 @@ ParameterHandler::recursively_print_parameters(
                     78 - overall_indent_level * 2 - 2);
 
                 for (const auto &doc_line : doc_lines)
-                  out << std::setw(overall_indent_level * 2) << ""
-                      << "# " << doc_line << '\n';
+                  {
+                    out << std::setw(overall_indent_level * 2) << '#';
+
+                    if (!doc_line.empty())
+                      out << ' ' << doc_line;
+
+                    out << '\n';
+                  }
               }
 
-            // print name and value of this entry
-            out << std::setw(overall_indent_level * 2) << ""
-                << "set " << demangle(p.first)
-                << std::setw(longest_name - demangle(p.first).size() + 1) << " "
-                << "= " << value;
+            // print the name and (if set) value of this entry
+            out << std::setw(overall_indent_level * 2) << "set "
+                << demangle(p.first)
+                << std::setw(longest_name - demangle(p.first).size() + 1) << ' '
+                << '=';
+            if (!value.empty())
+              out << ' ' << value;
 
             // finally print the default value, but only if it differs
             // from the actual value

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.