From: David Wells Date: Sat, 27 Jan 2018 18:25:16 +0000 (-0500) Subject: Use constant references instead of copies. X-Git-Tag: v9.0.0-rc1~505^2~1 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=714732d9416124cb9a33f4e5ebc375be114c1abc;p=dealii.git Use constant references instead of copies. This was found by cppcheck. --- diff --git a/include/deal.II/base/timer.h b/include/deal.II/base/timer.h index 6ba90bf7fe..75d64f2cbf 100644 --- a/include/deal.II/base/timer.h +++ b/include/deal.II/base/timer.h @@ -945,7 +945,7 @@ inline void Timer::print_last_lap_wall_time_data(StreamType &stream) const { - const Utilities::MPI::MinMaxAvg statistic = get_last_lap_wall_time_data(); + const Utilities::MPI::MinMaxAvg &statistic = get_last_lap_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/numerics/data_out_dof_data.h b/include/deal.II/numerics/data_out_dof_data.h index 6b05d428ac..6dff5d8004 100644 --- a/include/deal.II/numerics/data_out_dof_data.h +++ b/include/deal.II/numerics/data_out_dof_data.h @@ -1016,7 +1016,7 @@ DataOut_DoFData:: merge_patches (const DataOut_DoFData &source, const Point &shift) { - const std::vector source_patches = source.get_patches (); + const std::vector &source_patches = source.get_patches (); Assert ((patches.size () != 0) && (source_patches.size () != 0), ExcMessage ("When calling this function, both the current "