bloom: fix minimum value of n
This commit is contained in:
parent
f8fa536129
commit
f5a00c6e6b
@ -166,7 +166,7 @@ Bloom.fromRate = function fromRate(items, rate, update) {
|
|||||||
if (update !== -1)
|
if (update !== -1)
|
||||||
size = Math.min(size, constants.bloom.MAX_BLOOM_FILTER_SIZE * 8);
|
size = Math.min(size, constants.bloom.MAX_BLOOM_FILTER_SIZE * 8);
|
||||||
|
|
||||||
n = (size / items * LN2) | 0;
|
n = ((size / items * LN2) | 0) || 1;
|
||||||
|
|
||||||
if (update !== -1)
|
if (update !== -1)
|
||||||
n = Math.min(n, constants.bloom.MAX_HASH_FUNCS);
|
n = Math.min(n, constants.bloom.MAX_HASH_FUNCS);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user