]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
dnsdist: Fix clang-tidy's nits 15585/head
authorRemi Gacogne <remi.gacogne@powerdns.com>
Fri, 23 May 2025 07:09:16 +0000 (09:09 +0200)
committerRemi Gacogne <remi.gacogne@powerdns.com>
Fri, 23 May 2025 07:09:16 +0000 (09:09 +0200)
pdns/dnsdistdist/dnsdist-lua-rules.cc

index 2ba7069652af3ea74d021b8b06222002da40c3dc..d86fca27ac4ce3edf159679249096b17d053d8a4 100644 (file)
@@ -625,8 +625,9 @@ void setupLuaRules(LuaContext& luaCtx)
     return std::shared_ptr<DNSRule>(new QNameSetRule(names));
   });
 
-  luaCtx.writeFunction("TagRule", [](std::string tag, boost::optional<std::string> value) {
-    return std::shared_ptr<DNSRule>(dnsdist::selectors::getTagSelector(tag, boostToStandardOptional(value), value ? false : true));
+  // NOLINTNEXTLINE(performance-unnecessary-value-param): LuaWrapper does not play well with const boost::optional<T>&
+  luaCtx.writeFunction("TagRule", [](const std::string& tag, boost::optional<std::string> value) {
+    return std::shared_ptr<DNSRule>(dnsdist::selectors::getTagSelector(tag, boostToStandardOptional(value), !value));
   });
 
 #if defined(HAVE_LMDB) || defined(HAVE_CDB)