From: Miod Vallat Date: Thu, 21 Aug 2025 06:03:14 +0000 (+0200) Subject: Use canonCompare_three_way instead of canonCompare twice. X-Git-Tag: rec-5.4.0-alpha1~313^2~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e7dfa5591f4881bf1e05e3b6da5317d63b40be9f;p=thirdparty%2Fpdns.git Use canonCompare_three_way instead of canonCompare twice. Signed-off-by: Miod Vallat --- diff --git a/pdns/dnsparser.hh b/pdns/dnsparser.hh index 7bd667dee3..f5f82695c4 100644 --- a/pdns/dnsparser.hh +++ b/pdns/dnsparser.hh @@ -398,10 +398,13 @@ public: auto aType = (a.d_type == QType::SOA) ? 0 : a.d_type; auto bType = (b.d_type == QType::SOA) ? 0 : b.d_type; - if(a.d_name.canonCompare(b.d_name)) + int res = a.d_name.canonCompare_three_way(b.d_name); + if (res < 0) { return true; - if(b.d_name.canonCompare(a.d_name)) + } + if (res > 0) { return false; + } if(std::tie(aType, a.d_class, a.d_ttl) < std::tie(bType, b.d_class, b.d_ttl)) return true;