diff --git a/plugins/cachekey/pattern.cc b/plugins/cachekey/pattern.cc index 515cd8f4f0b..22453bfaff4 100644 --- a/plugins/cachekey/pattern.cc +++ b/plugins/cachekey/pattern.cc @@ -145,7 +145,7 @@ Pattern::process(const String &subject, StringVector &result) /* Replacement pattern was provided in the configuration - capture and replace. */ String element; if (replace(subject, element)) { - result.push_back(element); + result.push_back(std::move(element)); } else { return false; } @@ -154,11 +154,11 @@ Pattern::process(const String &subject, StringVector &result) StringVector captures; if (capture(subject, captures)) { if (captures.size() == 1) { - result.push_back(captures[0]); + result.push_back(std::move(captures[0])); } else { StringVector::iterator it = captures.begin() + 1; for (; it != captures.end(); it++) { - result.push_back(*it); + result.push_back(std::move(*it)); } } } else { @@ -224,7 +224,7 @@ Pattern::capture(const String &subject, StringVector &result) String dst(capture.data(), capture.length()); CacheKeyDebug("capturing '%s' %d", dst.c_str(), i); - result.push_back(dst); + result.push_back(std::move(dst)); } return true; diff --git a/plugins/experimental/rate_limit/limiter.h b/plugins/experimental/rate_limit/limiter.h index 038c295faf1..cbddb6859a8 100644 --- a/plugins/experimental/rate_limit/limiter.h +++ b/plugins/experimental/rate_limit/limiter.h @@ -225,7 +225,7 @@ template class RateLimiter std::string tag = metrics["tag"] ? metrics["tag"].as() : name(); Dbg(dbg_ctl, "Metrics for selector rule: %s(%s, %s)", name().c_str(), prefix.c_str(), tag.c_str()); - initializeMetrics(RATE_LIMITER_TYPE_SNI, prefix, tag); + initializeMetrics(RATE_LIMITER_TYPE_SNI, std::move(prefix), std::move(tag)); } return true; diff --git a/plugins/header_rewrite/parser.cc b/plugins/header_rewrite/parser.cc index c1f467d39a8..ba41e644cc7 100644 --- a/plugins/header_rewrite/parser.cc +++ b/plugins/header_rewrite/parser.cc @@ -185,11 +185,11 @@ Parser::preprocess(std::vector tokens) // This produces an error, but it's not fatal for load / reload. ToDo: ATS v11 fix. TSError("[%s] Duplicate modifier: %s", PLUGIN_NAME, t.c_str()); } else { - _mods.push_back(t); + _mods.push_back(std::move(t)); } } } else { - _mods.push_back(m); + _mods.push_back(std::move(m)); } tokens.pop_back(); // consume it, so we don't concatenate it into the value } else { @@ -228,7 +228,7 @@ Parser::preprocess(std::vector tokens) _arg = tokens[1] + tokens[2]; } else if (tokens.size() > 1) { // This is for the regular expression, which for some reason has its own handling?? ToDo: Why ? - _arg = tokens[1]; + _arg = std::move(tokens[1]); } else { // This would be for hook conditions, which has no argument. _arg = ""; @@ -240,9 +240,9 @@ Parser::preprocess(std::vector tokens) } } else { // Operator has no qualifiers, but could take an optional second argument - _op = tokens[0]; + _op = std::move(tokens[0]); if (tokens.size() > 1) { - _arg = tokens[1]; + _arg = std::move(tokens[1]); if (tokens.size() > 2) { for (auto it = tokens.begin() + 2; it != tokens.end(); it++) {