From 8af83d7b3f2a3f517847116dd48c9d23555e6562 Mon Sep 17 00:00:00 2001 From: Miod Vallat Date: Thu, 26 Jun 2025 11:04:56 +0200 Subject: [PATCH] Try to make clang-tidy less unhappy. Yawn. Signed-off-by: Miod Vallat --- pdns/dnsname.cc | 38 +++++++++++++++++++++++--------------- 1 file changed, 23 insertions(+), 15 deletions(-) diff --git a/pdns/dnsname.cc b/pdns/dnsname.cc index 7ac2b77316..3afad0fcfa 100644 --- a/pdns/dnsname.cc +++ b/pdns/dnsname.cc @@ -473,8 +473,8 @@ int DNSName::slowCanonCompare_three_way(const DNSName& rhs) const auto iter2 = rhsLabels.rbegin(); const auto& last2 = rhsLabels.rend(); while (iter1 != last1 && iter2 != last2) { - if (int rc = pdns_ilexicographical_compare_three_way(*iter1, *iter2); rc != 0) { - return rc; + if (int res = pdns_ilexicographical_compare_three_way(*iter1, *iter2); res != 0) { + return res; } ++iter1; // NOLINT(cppcoreguidelines-pro-bounds-pointer-arithmetic) ++iter2; // NOLINT(cppcoreguidelines-pro-bounds-pointer-arithmetic) @@ -500,15 +500,21 @@ int DNSName::canonCompare_three_way(const DNSName& rhs) const // 0,2,6,a // 0,4,a - uint8_t ourpos[64], rhspos[64]; - uint8_t ourcount=0, rhscount=0; + std::array ourpos{}; + std::array rhspos{}; + uint8_t ourcount=0; + uint8_t rhscount=0; //cout<<"Asked to compare "<