Skip to content

Commit c79bea7

Browse files
committed
Fixing issue 40.
1 parent 7ee0e1d commit c79bea7

File tree

2 files changed

+1
-4
lines changed

2 files changed

+1
-4
lines changed

fastfilter/src/main/java/org/fastfilter/utils/Hash.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public static long randomSeed() {
3232
*/
3333
public static int reduce(int hash, int n) {
3434
// http://lemire.me/blog/2016/06/27/a-fast-alternative-to-the-modulo-reduction/
35-
return (int) (((hash & 0xffffffffL) * n) >>> 32);
35+
return (int) (((hash & 0xffffffffL) * (n & 0xffffffffL)) >>> 32);
3636
}
3737

3838
/**

fastfilter/src/test/java/org/fastfilter/TestAllFilters.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -183,9 +183,6 @@ private static void test(TestFilterType type, int len, int seed, boolean log) {
183183
}
184184
time = System.nanoTime() - time;
185185
nanosPerRemove = time / len;
186-
if (f.cardinality() != 0) {
187-
System.out.println(f.cardinality());
188-
}
189186
assertEquals(f.toString(), 0, f.cardinality());
190187
}
191188
if (log) {

0 commit comments

Comments
 (0)