Address a long standing bug in a Where.add optimization to discard equal nodes that was surfaced by implementing equality for Lookup instances in bbf141bcdc. Thanks Shaheed Haque for the report. Backport of b81c7562fc from main
bbf141bcdc
b81c7562fc