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(setA, "setA");
|
||||||
Objects.requireNonNull(setB, "setB");
|
Objects.requireNonNull(setB, "setB");
|
||||||
|
|
||||||
final Predicate<E> containedInB = object -> setB.contains(object);
|
final Predicate<E> containedInB = setB::contains;
|
||||||
|
|
||||||
return new SetView<E>() {
|
return new SetView<E>() {
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -80,9 +80,7 @@ public class HasherBloomFilter extends AbstractBloomFilter {
|
||||||
public boolean contains(final Hasher hasher) {
|
public boolean contains(final Hasher hasher) {
|
||||||
verifyHasher(hasher);
|
verifyHasher(hasher);
|
||||||
final Set<Integer> set = new TreeSet<>();
|
final Set<Integer> set = new TreeSet<>();
|
||||||
hasher.iterator(getShape()).forEachRemaining((IntConsumer) idx -> {
|
hasher.iterator(getShape()).forEachRemaining((IntConsumer) set::add);
|
||||||
set.add(idx);
|
|
||||||
});
|
|
||||||
final OfInt iter = this.hasher.iterator(getShape());
|
final OfInt iter = this.hasher.iterator(getShape());
|
||||||
while (iter.hasNext()) {
|
while (iter.hasNext()) {
|
||||||
final int idx = iter.nextInt();
|
final int idx = iter.nextInt();
|
||||||
|
|
Loading…
Reference in New Issue