Commit 0bd8cd29 authored by Jakub Sztandera's avatar Jakub Sztandera Committed by GitHub

Merge pull request #1 from magik6k/fix/empty

Create valid filters for zero numEntries
parents 0f5286d2 7dffc1f8
0.1.0: QmeiMCBkYHxkDkDfnDadzz4YxY5ruL5Pj499essE4vRsGM
0.1.1: QmXqKGu7QzfRzFC4yd5aL9sThYx22vY163VGwmxfp5qGHk
......@@ -62,7 +62,7 @@ func New(params ...float64) (bloomfilter *Bloom, err error) {
return nil, ErrInvalidParms
}
if params[1] < 1 {
entries, locs = calcSizeByWrongPositives(params[0], params[1])
entries, locs = calcSizeByWrongPositives(math.Max(params[0], 1), params[1])
} else {
entries, locs = uint64(params[0]), uint64(params[1])
}
......
......@@ -10,5 +10,6 @@
"language": "go",
"license": "MIT",
"name": "bbloom",
"version": "0.1.0"
"version": "0.1.1"
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment