Skip to content

Commit 9f7887a

Browse files
authored
Merge pull request #314 from hennekey/parameterize-bloom-filter
Utilize the `d` parameter
2 parents e0c82f7 + 348b533 commit 9f7887a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

commons/src/main/java/org/archive/util/BloomFilter64bit.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ public BloomFilter64bit( final long n, final int d, boolean roundUp) {
8080
* @param roundUp if true, round bit size up to next-nearest-power-of-2
8181
*/
8282
public BloomFilter64bit(final long n, final int d, Random weightsGenerator, boolean roundUp ) {
83-
delegate = com.google.common.hash.BloomFilter.create(Funnels.unencodedCharsFunnel(), Ints.saturatedCast(n), 0.0000003);
83+
delegate = com.google.common.hash.BloomFilter.create(Funnels.unencodedCharsFunnel(), Ints.saturatedCast(n), Math.pow(2, -d));
8484
this.expectedInserts = n;
8585
try {
8686
Method bitSizeMethod = delegate.getClass().getDeclaredMethod("bitSize", new Class[] {});

0 commit comments

Comments
 (0)