From 8ba4266e91ea0a1bb7a419f3f10a2e6e5038f38f Mon Sep 17 00:00:00 2001 From: Luca Heltai Date: Wed, 10 Apr 2019 18:40:59 +0200 Subject: [PATCH] Comply with clang-tidy. --- include/deal.II/base/patterns.h | 2 +- source/base/parsed_convergence_table.cc | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/include/deal.II/base/patterns.h b/include/deal.II/base/patterns.h index bbb5b50adf..963eaa3779 100644 --- a/include/deal.II/base/patterns.h +++ b/include/deal.II/base/patterns.h @@ -1803,7 +1803,7 @@ namespace Patterns std::vector vec(t.size()); unsigned int i = 0; - for (const auto entry : t) + for (const auto &entry : t) vec[i++] = Convert::to_string(entry, base_p); std::string s; diff --git a/source/base/parsed_convergence_table.cc b/source/base/parsed_convergence_table.cc index 0139d976d2..cda4afffb8 100644 --- a/source/base/parsed_convergence_table.cc +++ b/source/base/parsed_convergence_table.cc @@ -48,10 +48,10 @@ namespace for (unsigned int i = 0; i < component_names.size(); ++i) { if (unique_component_names[j] != component_names[i]) - masks.push_back(ComponentMask(bools[j++])); + masks.emplace_back(ComponentMask(bools[j++])); bools[j][i] = true; } - masks.push_back(ComponentMask(bools[j++])); + masks.emplace_back(ComponentMask(bools[j++])); AssertDimension(j, unique_component_names.size()); return masks; } @@ -174,7 +174,7 @@ ParsedConvergenceTable::output_table(std::ostream &out) if (error_file_name != "") { const std::string error_file_format = - error_file_name.substr(error_file_name.find_last_of(".") + 1); + error_file_name.substr(error_file_name.find_last_of('.') + 1); std::ofstream table_file(error_file_name); -- 2.39.5