This is an automated email from the ASF dual-hosted git repository.
ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-collections.git
The following commit(s) were added to refs/heads/master by this push:
new 4a44d66b7 Simplify SparseBloomFilter.processIndices(IntPredicate) with
a stream
4a44d66b7 is described below
commit 4a44d66b73003a47585ac3f70db8d116a498ac47
Author: Gary Gregory <[email protected]>
AuthorDate: Fri Oct 18 18:44:21 2024 -0400
Simplify SparseBloomFilter.processIndices(IntPredicate) with a stream
---
.../apache/commons/collections4/bloomfilter/SparseBloomFilter.java | 7 +------
1 file changed, 1 insertion(+), 6 deletions(-)
diff --git
a/src/main/java/org/apache/commons/collections4/bloomfilter/SparseBloomFilter.java
b/src/main/java/org/apache/commons/collections4/bloomfilter/SparseBloomFilter.java
index 6a1c06bd7..731770486 100644
---
a/src/main/java/org/apache/commons/collections4/bloomfilter/SparseBloomFilter.java
+++
b/src/main/java/org/apache/commons/collections4/bloomfilter/SparseBloomFilter.java
@@ -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);
}
}