]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Use canonCompare_three_way instead of canonCompare twice.
authorMiod Vallat <miod.vallat@powerdns.com>
Thu, 21 Aug 2025 06:03:14 +0000 (08:03 +0200)
committerMiod Vallat <miod.vallat@powerdns.com>
Thu, 4 Sep 2025 09:14:00 +0000 (11:14 +0200)
Signed-off-by: Miod Vallat <miod.vallat@powerdns.com>
pdns/dnsparser.hh

index 7bd667dee395618ee8a68ed83d90b589a4b807a1..f5f82695c4e31dd366792e766fada1cb7d230e0f 100644 (file)
@@ -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;