-
-
Save starius/2c0dea4d9ee39a03b17471a85a06e164 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| diff --git a/bloom.go b/bloom.go | |
| index e19ba10..b7f74c7 100644 | |
| --- a/bloom.go | |
| +++ b/bloom.go | |
| @@ -72,6 +72,9 @@ type BloomFilter struct { | |
| // New creates a new Bloom filter with _m_ bits and _k_ hashing functions | |
| func New(m uint, k uint) *BloomFilter { | |
| + if m == 0 { | |
| + m = 1 | |
| + } | |
| return &BloomFilter{m, k, bitset.New(m)} | |
| } | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment