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() {
5050 @ Override
5151 public void add (long key ) {
5252 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 ;
5555 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 ;
5757 a += b ;
5858 }
5959 }
6060
6161 @ Override
6262 public boolean mayContain (long key ) {
6363 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 ;
6666 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 ) {
6868 return false ;
6969 }
7070 a += b ;
You can’t perform that action at this time.
0 commit comments