]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
dnsdist: Get rid of std::move() calls preventing copy elision 5359/head
authorRemi Gacogne <remi.gacogne@powerdns.com>
Thu, 1 Jun 2017 09:11:40 +0000 (11:11 +0200)
committerRemi Gacogne <remi.gacogne@powerdns.com>
Thu, 1 Jun 2017 09:11:40 +0000 (11:11 +0200)
pdns/dnsdist-lua.cc
pdns/dnsdist.cc

index 89ce577f2453abcc18aca500a6024dc82b3175d7..a56181b878071801334a89b524155de88614d783 100644 (file)
@@ -309,11 +309,11 @@ vector<std::function<void(void)>> setupLua(bool client, const std::string& confi
                          if (ret->connected) {
                            if(g_launchWork) {
                              g_launchWork->push_back([ret]() {
-                               ret->tid = move(thread(responderThread, ret));
+                               ret->tid = thread(responderThread, ret);
                              });
                            }
                            else {
-                             ret->tid = move(thread(responderThread, ret));
+                             ret->tid = thread(responderThread, ret);
                            }
                          }
 
@@ -470,11 +470,11 @@ vector<std::function<void(void)>> setupLua(bool client, const std::string& confi
                        if (ret->connected) {
                          if(g_launchWork) {
                            g_launchWork->push_back([ret]() {
-                             ret->tid = move(thread(responderThread, ret));
+                             ret->tid = thread(responderThread, ret);
                            });
                          }
                          else {
-                           ret->tid = move(thread(responderThread, ret));
+                           ret->tid = thread(responderThread, ret);
                          }
                        }
 
index 025dd8701ff8e069180d84ce0ee09666b95462fe..592eae28e72921fba4a98570d99918575b235f57 100644 (file)
@@ -1505,7 +1505,7 @@ void* healthChecksThread()
             try {
               SConnect(dss->fd, dss->remote);
               dss->connected = true;
-              dss->tid = move(thread(responderThread, dss));
+              dss->tid = thread(responderThread, dss);
             }
             catch(const std::runtime_error& error) {
               infolog("Error connecting to new server with address %s: %s", dss->remote.toStringWithPort(), error.what());
@@ -2184,7 +2184,7 @@ try
       auto ret=std::make_shared<DownstreamState>(ComboAddress(address, 53));
       addServerToPool(localPools, "", ret);
       if (ret->connected) {
-        ret->tid = move(thread(responderThread, ret));
+        ret->tid = thread(responderThread, ret);
       }
       g_dstates.modify([ret](servers_t& servers) { servers.push_back(ret); });
     }