Skip to content

Commit

Permalink
dnsdist: More clang-tidy fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
rgacogne committed Dec 15, 2023
1 parent 8f1f7f5 commit 45b4d19
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pdns/dnsdist-lua-bindings.cc
Original file line number Diff line number Diff line change
Expand Up @@ -107,14 +107,14 @@ void setupLuaBindings(LuaContext& luaCtx, bool client, bool configCheck)

#ifndef DISABLE_DOWNSTREAM_BINDINGS
/* DownstreamState */
luaCtx.registerFunction<void(DownstreamState::*)(int)>("setQPS", [](DownstreamState& state, int lim) { state.qps = lim ? QPSLimiter(lim, lim) : QPSLimiter(); });
luaCtx.registerFunction<void(std::shared_ptr<DownstreamState>::*)(string)>("addPool", [](std::shared_ptr<DownstreamState> state, string pool) {
luaCtx.registerFunction<void(DownstreamState::*)(int)>("setQPS", [](DownstreamState& state, int lim) { state.qps = lim > 0 ? QPSLimiter(lim, lim) : QPSLimiter(); });
luaCtx.registerFunction<void(std::shared_ptr<DownstreamState>::*)(string)>("addPool", [](const std::shared_ptr<DownstreamState>& state, string pool) {

Check warning on line 111 in pdns/dnsdist-lua-bindings.cc

View workflow job for this annotation

GitHub Actions / Analyze (cpp, dnsdist)

the parameter 'pool' is copied for each invocation but only used as a const reference; consider making it a const reference (performance-unnecessary-value-param - Level=Warning)
auto localPools = g_pools.getCopy();
addServerToPool(localPools, pool, state);
g_pools.setState(localPools);
state->d_config.pools.insert(pool);
});
luaCtx.registerFunction<void(std::shared_ptr<DownstreamState>::*)(string)>("rmPool", [](std::shared_ptr<DownstreamState> state, string pool) {
luaCtx.registerFunction<void(std::shared_ptr<DownstreamState>::*)(string)>("rmPool", [](const std::shared_ptr<DownstreamState>& state, string pool) {

Check warning on line 117 in pdns/dnsdist-lua-bindings.cc

View workflow job for this annotation

GitHub Actions / Analyze (cpp, dnsdist)

the parameter 'pool' is copied for each invocation but only used as a const reference; consider making it a const reference (performance-unnecessary-value-param - Level=Warning)
auto localPools = g_pools.getCopy();
removeServerFromPool(localPools, pool, state);
g_pools.setState(localPools);
Expand Down

0 comments on commit 45b4d19

Please sign in to comment.