Simplify SparseBloomFilter.processIndices(IntPredicate) with a stream

This commit is contained in:
Gary Gregory 2024-10-18 18:44:21 -04:00
parent 520967d5eb
commit 4a44d66b73
1 changed files with 1 additions and 6 deletions

View File

@ -199,11 +199,6 @@ public final class SparseBloomFilter implements BloomFilter<SparseBloomFilter> {
@Override
public boolean processIndices(final IntPredicate consumer) {
Objects.requireNonNull(consumer, "consumer");
for (final int value : indices) {
if (!consumer.test(value)) {
return false;
}
}
return true;
return indices.stream().allMatch(consumer::test);
}
}