From: Daniel Arndt Date: Fri, 20 Oct 2017 23:39:46 +0000 (+0200) Subject: Fix ParameterAcceptor X-Git-Tag: v9.0.0-rc1~913^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=eccefc393b2951b4cc72920af3b11d3eadef0a9b;p=dealii.git Fix ParameterAcceptor --- diff --git a/source/base/parameter_acceptor.cc b/source/base/parameter_acceptor.cc index 31441f92d6..29efc99b27 100644 --- a/source/base/parameter_acceptor.cc +++ b/source/base/parameter_acceptor.cc @@ -58,7 +58,7 @@ ParameterAcceptor::initialize(const std::string &filename, if (filename != "") { // check the extension of input file - if (filename.substr(filename.find_last_of(".") + 1) == "prm") + if (filename.substr(filename.find_last_of('.') + 1) == "prm") { try { @@ -75,7 +75,7 @@ ParameterAcceptor::initialize(const std::string &filename, "We created it for you.")); } } - else if (filename.substr(filename.find_last_of(".") + 1) == "xml") + else if (filename.substr(filename.find_last_of('.') + 1) == "xml") { std::ifstream is(filename); if (!is) @@ -98,7 +98,7 @@ ParameterAcceptor::initialize(const std::string &filename, { std::ofstream outfile(output_filename.c_str()); Assert(outfile, ExcIO()); - std::string extension = output_filename.substr(output_filename.find_last_of(".") + 1); + std::string extension = output_filename.substr(output_filename.find_last_of('.') + 1); if ( extension == "prm") { @@ -220,7 +220,7 @@ ParameterAcceptor::get_section_path() const void ParameterAcceptor::enter_my_subsection(ParameterHandler &prm=ParameterAcceptor::prm) { const auto sections = get_section_path(); - for (auto sec : sections) + for (const auto &sec : sections) { prm.enter_subsection(sec); } @@ -229,7 +229,7 @@ void ParameterAcceptor::enter_my_subsection(ParameterHandler &prm=ParameterAccep void ParameterAcceptor::leave_my_subsection(ParameterHandler &prm=ParameterAcceptor::prm) { const auto sections = get_section_path(); - for (auto sec : sections) + for (const auto &sec : sections) { prm.leave_subsection(); }