Use java 8 and method reference. (#274)
This commit is contained in:
parent
2431972cc0
commit
e30b4d3700
|
@ -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
|
||||
|
|
|
@ -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();
|
||||
|
|
Loading…
Reference in New Issue