Use java 8 and method reference. (#274)

This commit is contained in:
Arturo Bernal 2022-03-04 14:58:30 +01:00 committed by GitHub
parent 2431972cc0
commit e30b4d3700
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 4 deletions

View File

@ -277,7 +277,7 @@ public class SetUtils {
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

View File

@ -80,9 +80,7 @@ public class HasherBloomFilter extends AbstractBloomFilter {
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();