]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
dnsdist: Apply clang-tidy comments
authorRemi Gacogne <remi.gacogne@powerdns.com>
Thu, 16 Nov 2023 13:50:01 +0000 (14:50 +0100)
committerRemi Gacogne <remi.gacogne@powerdns.com>
Mon, 4 Dec 2023 12:59:45 +0000 (13:59 +0100)
pdns/dnsdist-lua-rules.cc

index f3d6dd623cc5a6024942ce5b03a531711a094ab0..9cbeec7529d6d304cae6b2d34f3ccc4715d4c53f 100644 (file)
@@ -33,7 +33,7 @@ std::shared_ptr<DNSRule> 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<T> getRuleFromSelector(const std::vector<T>& 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<DNSRule> {