From: Remi Gacogne Date: Fri, 15 Dec 2023 10:00:37 +0000 (+0100) Subject: dnsdist: More clang-tidy fixes X-Git-Tag: auth-4.9.0-alpha1~28^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=45b4d19b202af20c79983574fa0731e3b7dc8fe3;p=thirdparty%2Fpdns.git dnsdist: More clang-tidy fixes --- diff --git a/pdns/dnsdist-lua-bindings.cc b/pdns/dnsdist-lua-bindings.cc index e25d74abe8..34a745bb60 100644 --- a/pdns/dnsdist-lua-bindings.cc +++ b/pdns/dnsdist-lua-bindings.cc @@ -107,14 +107,14 @@ void setupLuaBindings(LuaContext& luaCtx, bool client, bool configCheck) #ifndef DISABLE_DOWNSTREAM_BINDINGS /* DownstreamState */ - luaCtx.registerFunction("setQPS", [](DownstreamState& state, int lim) { state.qps = lim ? QPSLimiter(lim, lim) : QPSLimiter(); }); - luaCtx.registerFunction::*)(string)>("addPool", [](std::shared_ptr state, string pool) { + luaCtx.registerFunction("setQPS", [](DownstreamState& state, int lim) { state.qps = lim > 0 ? QPSLimiter(lim, lim) : QPSLimiter(); }); + luaCtx.registerFunction::*)(string)>("addPool", [](const std::shared_ptr& state, string pool) { auto localPools = g_pools.getCopy(); addServerToPool(localPools, pool, state); g_pools.setState(localPools); state->d_config.pools.insert(pool); }); - luaCtx.registerFunction::*)(string)>("rmPool", [](std::shared_ptr state, string pool) { + luaCtx.registerFunction::*)(string)>("rmPool", [](const std::shared_ptr& state, string pool) { auto localPools = g_pools.getCopy(); removeServerFromPool(localPools, pool, state); g_pools.setState(localPools);