]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
clang-tidy: remove pointless std::move
authorRosen Penev <rosenp@gmail.com>
Fri, 5 Feb 2021 01:08:53 +0000 (17:08 -0800)
committerRosen Penev <rosenp@gmail.com>
Fri, 5 Feb 2021 01:27:39 +0000 (17:27 -0800)
Found with performance-move-const-arg

Signed-off-by: Rosen Penev <rosenp@gmail.com>
pdns/ednsoptions.cc
pdns/lua-record.cc
pdns/svc-records.cc
pdns/webserver.cc

index ebda4d2dbb189dcbd30cb8f2694c5ceb2a58c4f0..8221f7201907e3c2f2ab24410d50d798c981b802 100644 (file)
@@ -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;
index 94464ead9c717c5eeaf3ba0e7a8aab13451c776c..504513174a6f23e29f3f57f2f0d484b385edb577 100644 (file)
@@ -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<int, wiplist_t> ips) {
-      vector<pair<int,ComboAddress> > conv = convWIplist(std::move(ips));
+      vector<pair<int,ComboAddress> > conv = convWIplist(ips);
 
       return pickwrandom(conv).toString();
     });
index 332209aeb98f0567cb80f159cf291925eeeef845..0b04f31e057da95878bf280f1df095d5f227e790 100644 (file)
@@ -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<std::string> &&value) {
@@ -96,7 +96,7 @@ SvcParam::SvcParam(const SvcParamKey &key, std::set<std::string> &&value) {
   }
   if (d_key == SvcParamKey::mandatory) {
     for (auto const &v: value) {
-      d_mandatory.insert(keyFromString(std::move(v)));
+      d_mandatory.insert(keyFromString(v));
     }
   }
 }
index da7ad858ae91acbbfe2991b0e402a2513bfaa2ac..ffc36baebd5a36e5c711d0a7d4ef284b6a5babac 100644 (file)
@@ -224,7 +224,7 @@ void WebServer::registerWebHandler(const string& url, const HandlerFunction& han
 static void *WebServerConnectionThreadStart(const WebServer* webServer, std::shared_ptr<Socket> client) {
   setThreadName("pdns-r/webhndlr");
   try {
-    webServer->serveConnection(std::move(client));
+    webServer->serveConnection(client);
   }
   catch(PDNSException &e) {
     g_log<<Logger::Error<<"PDNSException while serving a connection in main webserver thread: "<<e.reason<<endl;