Skip to content

Commit cccf73d

Browse files
committed
trivial: fix bloom filter init to isEmpty = true
Fixes newly initialized bloom filters being constructed with isEmpty(false), which still works but loses the possible speedup when checking for key membership in an empty filter.
1 parent 273bde3 commit cccf73d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/bloom.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ CBloomFilter::CBloomFilter(unsigned int nElements, double nFPRate, unsigned int
3434
* See https://en.wikipedia.org/wiki/Bloom_filter for an explanation of these formulas
3535
*/
3636
isFull(false),
37-
isEmpty(false),
37+
isEmpty(true),
3838
nHashFuncs(min((unsigned int)(vData.size() * 8 / nElements * LN2), MAX_HASH_FUNCS)),
3939
nTweak(nTweakIn),
4040
nFlags(nFlagsIn)

0 commit comments

Comments
 (0)