From: Miod Vallat Date: Wed, 23 Apr 2025 12:20:52 +0000 (+0200) Subject: Simplify !a.isPartOf(b) && a != b constructs. X-Git-Tag: dnsdist-2.0.0-alpha2~63^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F15441%2Fhead;p=thirdparty%2Fpdns.git 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. --- 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 '"<