From d514bd031dd7275b0cef22a59de1ffe376bd129d Mon Sep 17 00:00:00 2001 From: Remi Gacogne Date: Mon, 18 Nov 2019 10:13:08 +0100 Subject: [PATCH] rec: Prevent copies when updating the State Holder --- pdns/pdns_recursor.cc | 4 ++-- pdns/rec-lua-conf.cc | 2 +- pdns/rec_channel_rec.cc | 12 ++++++------ 3 files changed, 9 insertions(+), 9 deletions(-) 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<