diff options
| author | Emmanuel Gil Peyrot <linkmauve@linkmauve.fr> | 2018-06-18 16:54:54 +0000 |
|---|---|---|
| committer | Emmanuel Gil Peyrot <linkmauve@linkmauve.fr> | 2018-06-18 18:27:11 +0000 |
| commit | 571f36f1b61d316a2f2ace00fa94ba83ab1ac0a0 (patch) | |
| tree | 95696a57d31908e2d5b5853b4c84e3d53c700db1 /src/util/units.cpp | |
| parent | Update pdf-parser.cpp (diff) | |
| download | inkscape-571f36f1b61d316a2f2ace00fa94ba83ab1ac0a0.tar.gz inkscape-571f36f1b61d316a2f2ace00fa94ba83ab1ac0a0.zip | |
Run clang-tidy’s modernize-pass-by-value pass.
This avoids having to pass variables by reference before copying them
when calling a constructor.
Diffstat (limited to 'src/util/units.cpp')
| -rw-r--r-- | src/util/units.cpp | 17 |
1 files changed, 9 insertions, 8 deletions
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 <cerrno> #include <iomanip> #include <iostream> +#include <utility> #include <glib.h> #include <glibmm/regex.h> #include <glibmm/fileutils.h> @@ -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); } |
