Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge pull request #14 from eriksoe/bloom-performance-fix
Bloom filter: Have only one level when using large sparse array.
  • Loading branch information
krestenkrab committed Sep 25, 2012
2 parents adab955 + f978f56 commit 4592bc0
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/hanoidb_bloom.erl
Expand Up @@ -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 =
Expand Down

0 comments on commit 4592bc0

Please sign in to comment.