From: Remi Gacogne Date: Mon, 18 Nov 2019 09:13:08 +0000 (+0100) Subject: rec: Prevent copies when updating the State Holder X-Git-Tag: auth-4.3.0-alpha1~34^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d514bd031dd7275b0cef22a59de1ffe376bd129d;p=thirdparty%2Fpdns.git rec: Prevent copies when updating the State Holder --- diff --git a/pdns/pdns_recursor.cc b/pdns/pdns_recursor.cc index 116e0d6723..5f4d8faa75 100644 --- a/pdns/pdns_recursor.cc +++ b/pdns/pdns_recursor.cc @@ -4047,14 +4047,14 @@ static int serviceMain(int argc, char*argv[]) for (const auto &p : parts) { dontThrottleNames.add(DNSName(p)); } - g_dontThrottleNames.setState(dontThrottleNames); + g_dontThrottleNames.setState(std::move(dontThrottleNames)); NetmaskGroup dontThrottleNetmasks; stringtok(parts, ::arg()["dont-throttle-netmasks"]); for (const auto &p : parts) { dontThrottleNetmasks.addMask(Netmask(p)); } - g_dontThrottleNetmasks.setState(dontThrottleNetmasks); + g_dontThrottleNetmasks.setState(std::move(dontThrottleNetmasks)); } s_balancingFactor = ::arg().asDouble("distribution-load-factor"); diff --git a/pdns/rec-lua-conf.cc b/pdns/rec-lua-conf.cc index db9c02f750..339ea604f5 100644 --- a/pdns/rec-lua-conf.cc +++ b/pdns/rec-lua-conf.cc @@ -570,7 +570,7 @@ void loadRecursorLuaConfig(const std::string& fname, luaConfigDelayedThreads& de try { Lua.executeCode(ifs); - g_luaconfs.setState(lci); + g_luaconfs.setState(std::move(lci)); } catch(const LuaContext::ExecutionErrorException& e) { g_log<