Permalink
Browse files

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

  • Loading branch information...
1 parent b254a5e commit f978f5652ceb0c3b73648b3a9c22430f8fcf6321 @eriksoe eriksoe committed Sep 25, 2012
Showing with 4 additions and 1 deletion.
  1. +4 −1 src/hanoidb_bloom.erl
View
5 src/hanoidb_bloom.erl
@@ -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 =

0 comments on commit f978f56

Please sign in to comment.