From e46039efb190806b37b533f4ddd6ecd31896245b Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Fri, 27 Sep 2019 20:04:17 -0700 Subject: [PATCH] [clang-tidy] Pass by value with std::move Found with modernize-pass-by-value Signed-off-by: Rosen Penev --- src/Variant.cpp | 5 +++-- src/Variant.h | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/Variant.cpp b/src/Variant.cpp index d0afa4234..b755d7d04 100644 --- a/src/Variant.cpp +++ b/src/Variant.cpp @@ -27,6 +27,7 @@ #include #include #include +#include #include #include #include @@ -127,9 +128,9 @@ Variant::Variant (const double value) } //////////////////////////////////////////////////////////////////////////////// -Variant::Variant (const std::string& value) +Variant::Variant (std::string value) : _type (Variant::type_string) -, _string (value) +, _string (std::move(value)) { } diff --git a/src/Variant.h b/src/Variant.h index 05f1f575b..748830da8 100644 --- a/src/Variant.h +++ b/src/Variant.h @@ -47,7 +47,7 @@ public: Variant (const bool); Variant (const int); Variant (const double); - Variant (const std::string&); + Variant (std::string ); Variant (const char*); Variant (const time_t, const enum type);