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/widgets | |
| 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/widgets')
| -rw-r--r-- | src/widgets/ege-paint-def.cpp | 5 | ||||
| -rw-r--r-- | src/widgets/ege-paint-def.h | 2 |
2 files changed, 4 insertions, 3 deletions
diff --git a/src/widgets/ege-paint-def.cpp b/src/widgets/ege-paint-def.cpp index 8ed6bbfc5..83492329c 100644 --- a/src/widgets/ege-paint-def.cpp +++ b/src/widgets/ege-paint-def.cpp @@ -44,6 +44,7 @@ #include <sstream> #include <cstring> #include <cstdio> +#include <utility> #include <glibmm/i18n.h> #include <glibmm/stringutils.h> @@ -93,8 +94,8 @@ PaintDef::PaintDef( ColorType type ) : } } -PaintDef::PaintDef( unsigned int r, unsigned int g, unsigned int b, const std::string& description ) : - descr(description), +PaintDef::PaintDef( unsigned int r, unsigned int g, unsigned int b, std::string description ) : + descr(std::move(description)), type(RGB), r(r), g(g), diff --git a/src/widgets/ege-paint-def.h b/src/widgets/ege-paint-def.h index 856146019..c26fde1b2 100644 --- a/src/widgets/ege-paint-def.h +++ b/src/widgets/ege-paint-def.h @@ -56,7 +56,7 @@ public: PaintDef(); PaintDef(ColorType type); - PaintDef( unsigned int r, unsigned int g, unsigned int b, const std::string& description ); + PaintDef( unsigned int r, unsigned int g, unsigned int b, std::string description ); virtual ~PaintDef(); PaintDef( PaintDef const &other ); |
