From 992c145dbceac6ee408e7bbd9a221469a94ce0cd Mon Sep 17 00:00:00 2001 From: Miod Vallat Date: Wed, 23 Apr 2025 14:20:52 +0200 Subject: [PATCH] Simplify !a.isPartOf(b) && a != b constructs. By design, a.isPartOf(a) is always true. Therefore, if a and b compare equal, !a.isPartOf(b) and a != b are both false and the result of the expression is false, but also !a.isPartOf(b). If not, then a != b is true and the result of the expression is !a.isPartOf(b). Boolean algebra is hard, let's go shopping. --- pdns/pdnsutil.cc | 2 +- pdns/ws-auth.cc | 6 +++--- pdns/zonemd.cc | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/pdns/pdnsutil.cc b/pdns/pdnsutil.cc index 65d3a2f965..7559a3b75d 100644 --- a/pdns/pdnsutil.cc +++ b/pdns/pdnsutil.cc @@ -1574,7 +1574,7 @@ static int loadZone(const ZoneName& zone, const string& fname) { rr.domain_id=di.id; bool haveSOA = false; while(zpt.get(rr)) { - if(!rr.qname.isPartOf(zone) && rr.qname!=zone.operator const DNSName&()) { + if(!rr.qname.isPartOf(zone)) { cerr<<"File contains record named '"<