Skip to content

Commit 43ece06

Browse files
authored
Merge pull request #18 from itsmuntadhar/main
fix: Correct capacity validation to check hashes instead of capacity
2 parents 7a6bdd9 + a9530cb commit 43ece06

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/BloomFilter/Filter.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ public Filter(string name, long capacity, int hashes, HashFunction hashFunction)
8989
{
9090
if (capacity < 1)
9191
throw new ArgumentOutOfRangeException("capacity", capacity, "capacity must be > 0");
92-
if (capacity < 1)
92+
if (hashes < 1)
9393
throw new ArgumentOutOfRangeException("hashes", hashes, "hashes must be > 0");
9494

9595
Name = name;
@@ -268,4 +268,4 @@ protected static int LogMaxInt(long number, out int mod)
268268
/// Dispose
269269
/// </summary>
270270
public abstract void Dispose();
271-
}
271+
}

0 commit comments

Comments
 (0)