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=refs%2Fpull%2F17616%2Fhead;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