]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Use constant references instead of copies.
authorDavid Wells <wellsd2@rpi.edu>
Sat, 27 Jan 2018 18:25:16 +0000 (13:25 -0500)
committerDavid Wells <wellsd2@rpi.edu>
Sat, 27 Jan 2018 22:47:58 +0000 (17:47 -0500)
This was found by cppcheck.

include/deal.II/base/timer.h
include/deal.II/numerics/data_out_dof_data.h

index 6ba90bf7fe41a702ba658ad2bc65ad897888e40b..75d64f2cbf12ab95169902cea0744db1186e7833 100644 (file)
@@ -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;
index 6b05d428acce1b1adecfcc97aa84af73acced71b..6dff5d800436621ca609b8071b145bf2df3bebcc 100644 (file)
@@ -1016,7 +1016,7 @@ DataOut_DoFData<DoFHandlerType,patch_dim,patch_space_dim>::
 merge_patches (const DataOut_DoFData<DoFHandlerType2,patch_dim,patch_space_dim> &source,
                const Point<patch_space_dim> &shift)
 {
-  const std::vector<Patch> source_patches = source.get_patches ();
+  const std::vector<Patch> &source_patches = source.get_patches ();
   Assert ((patches.size () != 0) &&
           (source_patches.size () != 0),
           ExcMessage ("When calling this function, both the current "

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.