]> https://gitweb.dealii.org/ - dealii.git/commitdiff
cppcheck: clean up use of references.
authorDavid Wells <drwells@email.unc.edu>
Sat, 9 May 2020 19:30:58 +0000 (15:30 -0400)
committerDavid Wells <drwells@email.unc.edu>
Sat, 9 May 2020 23:24:48 +0000 (19:24 -0400)
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
include/deal.II/base/utilities.h

index 0873c3f95a03664a731b908059e60e2fb018478b..88149f0cff6c908ff12e8ae6802071feec0173b1 100644 (file)
@@ -947,7 +947,7 @@ template <class StreamType>
 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;
index e9541a50b5e8a5e1c43e2061d632ffddebd0d3aa..f83995c14fed45f5bcdb46a855ecd80f2f38fc21 100644 (file)
@@ -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));
           }

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.