]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Tweak boolean logic to make it more readable.
authorMiod Vallat <miod.vallat@powerdns.com>
Fri, 4 Jul 2025 13:29:03 +0000 (15:29 +0200)
committerMiod Vallat <miod.vallat@powerdns.com>
Fri, 4 Jul 2025 15:07:41 +0000 (17:07 +0200)
Signed-off-by: Miod Vallat <miod.vallat@powerdns.com>
modules/lmdbbackend/lmdbbackend.cc

index 8409dc0c0745b8e8242772e9631875fef914ef91..54777030b54ccf6bcea60ebb8bbe8d033be6c63f 100644 (file)
@@ -2752,11 +2752,12 @@ bool LMDBBackend::updateDNSSECOrderNameAndAuth(domainid_t domain_id, const DNSNa
     newRRs.reserve(lrrs.size());
     for (auto& lrr : lrrs) {
       lrr.qtype = compoundOrdername::getQType(key.getNoStripHeader<StringView>());
-      if (!needNSEC3 && qtype != QType::ANY) {
-        needNSEC3 = (lrr.hasOrderName && QType(qtype) != lrr.qtype);
+      bool isDifferentQType = qtype != QType::ANY && QType(qtype) != lrr.qtype;
+      if (!needNSEC3) {
+        needNSEC3 = lrr.hasOrderName && isDifferentQType;
       }
 
-      if ((qtype == QType::ANY || QType(qtype) == lrr.qtype) && (lrr.hasOrderName != hasOrderName || lrr.auth != auth)) {
+      if (!isDifferentQType && (lrr.hasOrderName != hasOrderName || lrr.auth != auth)) {
         lrr.auth = auth;
         lrr.hasOrderName = hasOrderName;
         changed = true;