From e7dfa5591f4881bf1e05e3b6da5317d63b40be9f Mon Sep 17 00:00:00 2001 From: Miod Vallat Date: Thu, 21 Aug 2025 08:03:14 +0200 Subject: [PATCH] Use canonCompare_three_way instead of canonCompare twice. Signed-off-by: Miod Vallat --- pdns/dnsparser.hh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/pdns/dnsparser.hh b/pdns/dnsparser.hh index 7bd667dee..f5f82695c 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; -- 2.47.3