From: Rene Gassmoeller Date: Tue, 27 Aug 2024 13:01:29 +0000 (+0200) Subject: Do not print unnecessary whitespace X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b0d1be6c9548474e142d62a2f1e5b0fc7b7e3f5e;p=dealii.git Do not print unnecessary whitespace --- diff --git a/source/base/parameter_handler.cc b/source/base/parameter_handler.cc index 189910f9fe..174d9a866b 100644 --- a/source/base/parameter_handler.cc +++ b/source/base/parameter_handler.cc @@ -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