Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions plugins/cachekey/pattern.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand All @@ -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 {
Expand Down Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion plugins/experimental/rate_limit/limiter.h
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ template <class T> class RateLimiter
std::string tag = metrics["tag"] ? metrics["tag"].as<std::string>() : 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;
Expand Down
10 changes: 5 additions & 5 deletions plugins/header_rewrite/parser.cc
Original file line number Diff line number Diff line change
Expand Up @@ -185,11 +185,11 @@ Parser::preprocess(std::vector<std::string> 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 {
Expand Down Expand Up @@ -228,7 +228,7 @@ Parser::preprocess(std::vector<std::string> 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 = "";
Expand All @@ -240,9 +240,9 @@ Parser::preprocess(std::vector<std::string> 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++) {
Expand Down