From 270e0c8070c7a9b5e620b3f323a8ae952c62cc80 Mon Sep 17 00:00:00 2001 From: Remi Gacogne Date: Fri, 9 Feb 2024 11:28:12 +0100 Subject: [PATCH] dnsdist: Prevent useless allocation+copy in `setPoolServerPolicy` --- pdns/dnsdist-lua.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pdns/dnsdist-lua.cc b/pdns/dnsdist-lua.cc index f261f453d2..8238360558 100644 --- a/pdns/dnsdist-lua.cc +++ b/pdns/dnsdist-lua.cc @@ -2255,7 +2255,7 @@ static void setupLuaConfig(LuaContext& luaCtx, bool client, bool configCheck) luaCtx.writeFunction("setPoolServerPolicy", [](const std::shared_ptr& policy, const string& pool) { setLuaSideEffect(); auto localPools = g_pools.getCopy(); - setPoolPolicy(localPools, pool, std::make_shared(*policy)); + setPoolPolicy(localPools, pool, policy); g_pools.setState(localPools); }); -- 2.47.2