Protect against div by 0
Make sure that blooms are always at least 1 slot in size
This commit is contained in:
parent
baa644383d
commit
b3e189b012
1 changed files with 1 additions and 1 deletions
|
@ -621,7 +621,7 @@ build_table_summary(SlotIndex, AllHashes, Level, FirstKey, L, MaxSQN) ->
|
|||
false ->
|
||||
element(2, lists:keyfind(default, 1, ?LEVEL_BLOOM_BITS))
|
||||
end,
|
||||
BloomSlots = (length(AllHashes) * BloomBits) div 4096,
|
||||
BloomSlots = max((length(AllHashes) * BloomBits) div 4096, 1),
|
||||
BloomAddFun =
|
||||
fun({H, _K}, Bloom) -> leveled_tinybloom:enter(H, Bloom) end,
|
||||
Bloom = lists:foldr(BloomAddFun,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue