Implement CompactHashMap.KeySetView.contains(), which somehow got lost when
forking from Guava. Without this, the sets generated from
CompactHashMap.keySet() linearly scan through the elements when contains() is
called. This does not seemed to be used anywhere at the moment, but preventing
this for future usages.
RELNOTES: None.
@@ -622,6 +622,11 @@ public class CompactHashMap<K, V> extends AbstractMap<K, V> implements Serializa
return Spliterators.spliterator(keys, 0, size, Spliterator.DISTINCT | Spliterator.ORDERED);
}
+ @Override
+ public boolean contains(Object o) {
+ return containsKey(o);
+ }
+
@Override
@SuppressWarnings("unchecked") // keys contains only Ks
public void forEach(Consumer<? super K> action) {
