From 571f36f1b61d316a2f2ace00fa94ba83ab1ac0a0 Mon Sep 17 00:00:00 2001 From: Emmanuel Gil Peyrot Date: Mon, 18 Jun 2018 18:54:54 +0200 Subject: =?UTF-8?q?Run=20clang-tidy=E2=80=99s=20modernize-pass-by-value=20?= =?UTF-8?q?pass.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This avoids having to pass variables by reference before copying them when calling a constructor. --- src/util/units.cpp | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'src/util/units.cpp') diff --git a/src/util/units.cpp b/src/util/units.cpp index ffa2681c6..340d3f697 100644 --- a/src/util/units.cpp +++ b/src/util/units.cpp @@ -17,6 +17,7 @@ #include #include #include +#include #include #include #include @@ -164,16 +165,16 @@ Unit::Unit() : Unit::Unit(UnitType type, double factor, - Glib::ustring const &name, - Glib::ustring const &name_plural, - Glib::ustring const &abbr, - Glib::ustring const &description) + Glib::ustring name, + Glib::ustring name_plural, + Glib::ustring abbr, + Glib::ustring description) : type(type) , factor(factor) - , name(name) - , name_plural(name_plural) - , abbr(abbr) - , description(description) + , name(std::move(name)) + , name_plural(std::move(name_plural)) + , abbr(std::move(abbr)) + , description(std::move(description)) { g_return_if_fail(factor <= 0); } -- cgit v1.2.3