From: Rosen Penev Date: Fri, 5 Feb 2021 01:08:53 +0000 (-0800) Subject: clang-tidy: remove pointless std::move X-Git-Tag: dnsdist-1.6.0-alpha2~55^2~4 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=beceefde77f4f5ce4d620e33b05343d48d46062c;p=thirdparty%2Fpdns.git clang-tidy: remove pointless std::move Found with performance-move-const-arg Signed-off-by: Rosen Penev --- diff --git a/pdns/ednsoptions.cc b/pdns/ednsoptions.cc index ebda4d2dbb..8221f72019 100644 --- a/pdns/ednsoptions.cc +++ b/pdns/ednsoptions.cc @@ -120,7 +120,7 @@ int getEDNSOptions(const char* optRR, const size_t len, EDNSOptionViewMap& optio EDNSOptionViewValue value; value.content = optRR + pos; value.size = optionLen; - options[optionCode].values.push_back(std::move(value)); + options[optionCode].values.push_back(value); /* skip this option */ pos += optionLen; diff --git a/pdns/lua-record.cc b/pdns/lua-record.cc index 94464ead9c..504513174a 100644 --- a/pdns/lua-record.cc +++ b/pdns/lua-record.cc @@ -824,7 +824,7 @@ static void setupLuaRecords() * @example pickwrandom({ {100, '1.2.3.4'}, {50, '5.4.3.2'}, {1, '192.168.1.0'} }) */ lua.writeFunction("pickwrandom", [](std::unordered_map ips) { - vector > conv = convWIplist(std::move(ips)); + vector > conv = convWIplist(ips); return pickwrandom(conv).toString(); }); diff --git a/pdns/svc-records.cc b/pdns/svc-records.cc index 332209aeb9..0b04f31e05 100644 --- a/pdns/svc-records.cc +++ b/pdns/svc-records.cc @@ -76,7 +76,7 @@ SvcParam::SvcParam(const SvcParamKey &key, const std::string &value) { d_echconfig = value; return; } - d_value = std::move(value); + d_value = value; } SvcParam::SvcParam(const SvcParamKey &key, std::vector &&value) { @@ -96,7 +96,7 @@ SvcParam::SvcParam(const SvcParamKey &key, std::set &&value) { } if (d_key == SvcParamKey::mandatory) { for (auto const &v: value) { - d_mandatory.insert(keyFromString(std::move(v))); + d_mandatory.insert(keyFromString(v)); } } } diff --git a/pdns/webserver.cc b/pdns/webserver.cc index da7ad858ae..ffc36baebd 100644 --- a/pdns/webserver.cc +++ b/pdns/webserver.cc @@ -224,7 +224,7 @@ void WebServer::registerWebHandler(const string& url, const HandlerFunction& han static void *WebServerConnectionThreadStart(const WebServer* webServer, std::shared_ptr client) { setThreadName("pdns-r/webhndlr"); try { - webServer->serveConnection(std::move(client)); + webServer->serveConnection(client); } catch(PDNSException &e) { g_log<