File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed
fastfilter/src/main/java/org/fastfilter/bloom Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -50,21 +50,21 @@ public boolean supportsAdd() {
50
50
@ Override
51
51
public void add (long key ) {
52
52
long hash = Hash .hash64 (key , seed );
53
- int a = (int ) ( hash >>> 32 );
54
- int b = ( int ) hash ;
53
+ long a = (hash >>> 32 ) | ( hash << 32 );
54
+ long b = hash ;
55
55
for (int i = 0 ; i < k ; i ++) {
56
- data [Hash .reduce (a , arraySize )] |= 1L << a ;
56
+ data [Hash .reduce (( int ) ( a >>> 32 ) , arraySize )] |= 1L << a ;
57
57
a += b ;
58
58
}
59
59
}
60
60
61
61
@ Override
62
62
public boolean mayContain (long key ) {
63
63
long hash = Hash .hash64 (key , seed );
64
- int a = (int ) ( hash >>> 32 );
65
- int b = ( int ) hash ;
64
+ long a = (hash >>> 32 ) | ( hash << 32 );
65
+ long b = hash ;
66
66
for (int i = 0 ; i < k ; i ++) {
67
- if ((data [Hash .reduce (a , arraySize )] & 1L << a ) == 0 ) {
67
+ if ((data [Hash .reduce (( int ) ( a >>> 32 ) , arraySize )] & 1L << a ) == 0 ) {
68
68
return false ;
69
69
}
70
70
a += b ;
You can’t perform that action at this time.
0 commit comments