Bloom filter: Have only one level when using large sparse array.

This commit is contained in:
Erik Søe Sørensen 2012-09-25 12:59:28 +02:00
parent b254a5e345
commit f978f5652c

View file

@ -71,7 +71,10 @@ bloom(N, E) when is_number(N), N >= 0,
bloom(bits, 32, E).
bloom(Mode, N, E) ->
K = 1 + trunc(log2(1/E)),
K = case Mode of
size -> 1 + trunc(log2(1/E));
bits -> 1
end,
P = pow(E, 1 / K),
Mb =