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/object/color-profile.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'src/object/color-profile.cpp') diff --git a/src/object/color-profile.cpp b/src/object/color-profile.cpp index 15cdf11fe..38064022a 100644 --- a/src/object/color-profile.cpp +++ b/src/object/color-profile.cpp @@ -16,6 +16,7 @@ #include #include +#include #include #include @@ -179,7 +180,7 @@ cmsHPROFILE ColorProfileImpl::getNULLProfile() { #endif // defined(HAVE_LIBLCMS1) || defined(HAVE_LIBLCMS2) -ColorProfile::FilePlusHome::FilePlusHome(Glib::ustring filename, bool isInHome) : filename(filename), isInHome(isInHome) { +ColorProfile::FilePlusHome::FilePlusHome(Glib::ustring filename, bool isInHome) : filename(std::move(filename)), isInHome(isInHome) { } ColorProfile::FilePlusHome::FilePlusHome(const ColorProfile::FilePlusHome &filePlusHome) : FilePlusHome(filePlusHome.filename, filePlusHome.isInHome) { @@ -194,7 +195,7 @@ bool ColorProfile::FilePlusHome::operator<(FilePlusHome const &other) const { } ColorProfile::FilePlusHomeAndName::FilePlusHomeAndName(ColorProfile::FilePlusHome filePlusHome, Glib::ustring name) - : FilePlusHome(filePlusHome), name(name) { + : FilePlusHome(filePlusHome), name(std::move(name)) { } bool ColorProfile::FilePlusHomeAndName::operator<(ColorProfile::FilePlusHomeAndName const &other) const { @@ -634,7 +635,7 @@ bool ColorProfile::GamutCheck(SPColor color) class ProfileInfo { public: - ProfileInfo( cmsHPROFILE prof, Glib::ustring const & path ); + ProfileInfo( cmsHPROFILE prof, Glib::ustring path ); Glib::ustring const& getName() {return _name;} Glib::ustring const& getPath() {return _path;} @@ -648,8 +649,8 @@ private: cmsProfileClassSignature _profileClass; }; -ProfileInfo::ProfileInfo( cmsHPROFILE prof, Glib::ustring const & path ) : - _path( path ), +ProfileInfo::ProfileInfo( cmsHPROFILE prof, Glib::ustring path ) : + _path(std::move( path )), _name( getNameFromProfile(prof) ), _profileSpace( cmsGetColorSpace( prof ) ), _profileClass( cmsGetDeviceClass( prof ) ) -- cgit v1.2.3