Skip to content
Permalink
Browse files
Use java 8 and method reference. (#274)
  • Loading branch information
arturobernalg committed Mar 4, 2022
1 parent 2431972 commit e30b4d37007c27ac866983c5be14551d420dd15d
Showing 2 changed files with 2 additions and 4 deletions.
@@ -277,7 +277,7 @@ public static <E> SetView<E> intersection(final Set<? extends E> setA, final Set
Objects.requireNonNull(setA, "setA");
Objects.requireNonNull(setB, "setB");

final Predicate<E> containedInB = object -> setB.contains(object);
final Predicate<E> containedInB = setB::contains;

return new SetView<E>() {
@Override
@@ -80,9 +80,7 @@ public int cardinality() {
public boolean contains(final Hasher hasher) {
verifyHasher(hasher);
final Set<Integer> set = new TreeSet<>();
hasher.iterator(getShape()).forEachRemaining((IntConsumer) idx -> {
set.add(idx);
});
hasher.iterator(getShape()).forEachRemaining((IntConsumer) set::add);
final OfInt iter = this.hasher.iterator(getShape());
while (iter.hasNext()) {
final int idx = iter.nextInt();

0 comments on commit e30b4d3

Please sign in to comment.