Fix performance issue with Set.member()