]> git.ipfire.org Git - thirdparty/pdns.git/commit
Simplify !a.isPartOf(b) && a != b constructs. 15441/head
authorMiod Vallat <miod.vallat@powerdns.com>
Wed, 23 Apr 2025 12:20:52 +0000 (14:20 +0200)
committerMiod Vallat <miod.vallat@powerdns.com>
Wed, 23 Apr 2025 14:46:21 +0000 (16:46 +0200)
commit992c145dbceac6ee408e7bbd9a221469a94ce0cd
treed1bc0c2094b780270caf3fb4e36b91903aeb564c
parentac7708d87f33e41b075423e517bf36cdaaf7bbfb
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
pdns/ws-auth.cc
pdns/zonemd.cc