From: Remi Gacogne Date: Thu, 16 Nov 2023 13:50:01 +0000 (+0100) Subject: dnsdist: Apply clang-tidy comments X-Git-Tag: dnsdist-1.9.0-alpha4~26^2~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=495e56eab11346735bac15fe799530d231b396d9;p=thirdparty%2Fpdns.git dnsdist: Apply clang-tidy comments --- diff --git a/pdns/dnsdist-lua-rules.cc b/pdns/dnsdist-lua-rules.cc index f3d6dd623c..9cbeec7529 100644 --- a/pdns/dnsdist-lua-rules.cc +++ b/pdns/dnsdist-lua-rules.cc @@ -33,7 +33,7 @@ std::shared_ptr makeRule(const luadnsrule_t& var, const std::string& ca bool suffixSeen = false; SuffixMatchNode smn; NetmaskGroup nmg; - auto add = [&nmg, &smn, &suffixSeen](string src) { + auto add = [&nmg, &smn, &suffixSeen](const string& src) { try { nmg.addMask(src); // need to try mask first, all masks are domain names! } catch (...) { @@ -283,6 +283,7 @@ static boost::optional getRuleFromSelector(const std::vector& rules, const return boost::none; } +// NOLINTNEXTLINE(readability-function-cognitive-complexity): this function declares Lua bindings, even with a good refactoring it will likely blow up the threshold void setupLuaRules(LuaContext& luaCtx) { luaCtx.writeFunction("makeRule", [](const luadnsrule_t& var) -> std::shared_ptr {