From: Ensar Sarajčić Date: Mon, 16 Dec 2024 10:42:44 +0000 (+0100) Subject: dnsdist: use `empty()` instead of "" check X-Git-Tag: dnsdist-2.0.0-alpha0^2~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=882718e14f10fe5fac4d5b6e29ee556a8ce4b514;p=thirdparty%2Fpdns.git dnsdist: use `empty()` instead of "" check --- diff --git a/pdns/dnsdistdist/dnsdist-web.cc b/pdns/dnsdistdist/dnsdist-web.cc index 55cbc1588d..91ad9110a7 100644 --- a/pdns/dnsdistdist/dnsdist-web.cc +++ b/pdns/dnsdistdist/dnsdist-web.cc @@ -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(&entry.d_value)) {