Skip to content

Commit 78df8cf

Browse files
authored
Simplify logic in BloomFilter.contains_many() (brainix#767)
1 parent fa9f60b commit 78df8cf

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pottery/bloom.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,7 @@ def contains_many(self, *values: JSONTypes) -> Generator[bool, None, None]:
358358
# I stole this recipe from here:
359359
# https://stackoverflow.com/a/61435714
360360
while bits_in_chunk := tuple(itertools.islice(bits, self.num_hashes())):
361-
yield bool(bits_in_chunk) and all(bits_in_chunk)
361+
yield all(bits_in_chunk)
362362

363363
def __repr__(self) -> str:
364364
'Return the string representation of the BloomFilter. O(1)'

0 commit comments

Comments
 (0)