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/widgets/ege-paint-def.cpp | 5 +++-- src/widgets/ege-paint-def.h | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) (limited to 'src/widgets') 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 #include #include +#include #include #include @@ -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 ); -- cgit v1.2.3