[cppcheck] add some std::move

Found with passedByValue

Signed-off-by: Rosen Penev <rosenp@gmail.com>
This commit is contained in:
Rosen Penev
2020-03-13 13:45:41 -07:00
committed by ridiculousfish
parent c3cb44cd22
commit 39861d54c5
6 changed files with 8 additions and 8 deletions

View File

@@ -617,7 +617,7 @@ class string_matcher_t {
public:
string_matcher_t(options_t opts_, io_streams_t &streams_)
: opts(opts_), streams(streams_), total_matched(0) {}
: opts(std::move(opts_)), streams(streams_), total_matched(0) {}
virtual ~string_matcher_t() = default;
virtual bool report_matches(const wcstring &arg) = 0;
@@ -879,7 +879,7 @@ class string_replacer_t {
public:
string_replacer_t(const wchar_t *argv0_, options_t opts_, io_streams_t &streams_)
: argv0(argv0_), opts(opts_), total_replaced(0), streams(streams_) {}
: argv0(argv0_), opts(std::move(opts_)), total_replaced(0), streams(streams_) {}
virtual ~string_replacer_t() = default;
int replace_count() const { return total_replaced; }