]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
dnsdist: use `empty()` instead of "" check
authorEnsar Sarajčić <dev@ensarsarajcic.com>
Mon, 16 Dec 2024 10:42:44 +0000 (11:42 +0100)
committerEnsar Sarajčić <dev@ensarsarajcic.com>
Mon, 16 Dec 2024 10:42:44 +0000 (11:42 +0100)
pdns/dnsdistdist/dnsdist-web.cc

index 55cbc1588dd389018db7f28fe65322ac2ba81daf..91ad9110a7f42ce3f37c49c59d6119d1179a88f6 100644 (file)
@@ -931,7 +931,7 @@ static void addStatsToJSONObject(Json::object& obj)
     if (entry.d_name == "special-memory-usage") {
       continue; // Too expensive for get-all
     }
-    if (entry.d_labels != "") {
+    if (entry.d_labels.empty()) {
       continue; // Skip labeled metrics to prevent duplicates
     }
     if (const auto& val = std::get_if<pdns::stat_t*>(&entry.d_value)) {