diff options
author | Robert McLaughlin <robert@sparkk.us> | 2016-11-01 21:04:26 -0400 |
---|---|---|
committer | Robert McLaughlin <robert@sparkk.us> | 2016-11-01 21:04:26 -0400 |
commit | cccf73db0483cc3945bf8389ce197df35e931e16 (patch) | |
tree | ea9a5ac879568d2d8969b75ed9618f6b59a0aa08 /src/bloom.cpp | |
parent | 273bde37d867d1f6ab67e22a65097b7adfc4831a (diff) |
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.
Diffstat (limited to 'src/bloom.cpp')
-rw-r--r-- | src/bloom.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/bloom.cpp b/src/bloom.cpp index 2677652ada..d00befc61c 100644 --- a/src/bloom.cpp +++ b/src/bloom.cpp @@ -34,7 +34,7 @@ CBloomFilter::CBloomFilter(unsigned int nElements, double nFPRate, unsigned int * See https://en.wikipedia.org/wiki/Bloom_filter for an explanation of these formulas */ isFull(false), - isEmpty(false), + isEmpty(true), nHashFuncs(min((unsigned int)(vData.size() * 8 / nElements * LN2), MAX_HASH_FUNCS)), nTweak(nTweakIn), nFlags(nFlagsIn) |