Skip to content

Commit

Permalink
Fixing issue 40.
Browse files Browse the repository at this point in the history
  • Loading branch information
lemire committed Oct 2, 2023
1 parent 7ee0e1d commit c79bea7
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 4 deletions.
2 changes: 1 addition & 1 deletion fastfilter/src/main/java/org/fastfilter/utils/Hash.java
Expand Up @@ -32,7 +32,7 @@ public static long randomSeed() {
*/
public static int reduce(int hash, int n) {
// http://lemire.me/blog/2016/06/27/a-fast-alternative-to-the-modulo-reduction/
return (int) (((hash & 0xffffffffL) * n) >>> 32);
return (int) (((hash & 0xffffffffL) * (n & 0xffffffffL)) >>> 32);
}

/**
Expand Down
3 changes: 0 additions & 3 deletions fastfilter/src/test/java/org/fastfilter/TestAllFilters.java
Expand Up @@ -183,9 +183,6 @@ private static void test(TestFilterType type, int len, int seed, boolean log) {
}
time = System.nanoTime() - time;
nanosPerRemove = time / len;
if (f.cardinality() != 0) {
System.out.println(f.cardinality());
}
assertEquals(f.toString(), 0, f.cardinality());
}
if (log) {
Expand Down

0 comments on commit c79bea7

Please sign in to comment.