From b8d49de535ac45a65600e7a2e16d1a057b82346e Mon Sep 17 00:00:00 2001 From: David Wells Date: Sat, 9 May 2020 15:30:58 -0400 Subject: [PATCH] cppcheck: clean up use of references. Capture by reference when the return type is by reference: capture by value when the return type is by value. --- include/deal.II/base/timer.h | 2 +- include/deal.II/base/utilities.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/deal.II/base/timer.h b/include/deal.II/base/timer.h index 0873c3f95a..88149f0cff 100644 --- a/include/deal.II/base/timer.h +++ b/include/deal.II/base/timer.h @@ -947,7 +947,7 @@ template inline void Timer::print_accumulated_wall_time_data(StreamType &stream) const { - const Utilities::MPI::MinMaxAvg statistic = get_accumulated_wall_time_data(); + const Utilities::MPI::MinMaxAvg &statistic = get_accumulated_wall_time_data(); stream << statistic.max << " wall," << " max @" << statistic.max_index << ", min=" << statistic.min << " @" << statistic.min_index << ", avg=" << statistic.avg << std::endl; diff --git a/include/deal.II/base/utilities.h b/include/deal.II/base/utilities.h index e9541a50b5..f83995c14f 100644 --- a/include/deal.II/base/utilities.h +++ b/include/deal.II/base/utilities.h @@ -1264,7 +1264,7 @@ namespace Utilities boost::archive::binary_oarchive archive(out); archive << object; - const std::string &s = out.str(); + const std::string s = out.str(); dest_buffer.reserve(dest_buffer.size() + s.size()); std::move(s.begin(), s.end(), std::back_inserter(dest_buffer)); } -- 2.39.5