void hashUpdate ( final long hash0 , final long hash1 ) { int col = Long . numberOfLeadingZeros ( hash1 ) ; if ( col < fiCol ) { return ; } // important speed optimization if ( col > 63 ) { col = 63 ; } // clip so that 0 <= col <= 63 final long c = numCoupons ; if ( c == 0 ) { promoteEmptyToSparse ( this ) ; } final long k = 1L << lgK ; final int row = ( int ) ( hash0 & ( k - 1L ) ) ; int rowCol = ( row << 6 ) | col ; // Avoid the hash table's "empty" value which is (2^26 -1, 63) (all ones) by changing it // to the pair (2^26 - 2, 63), which effectively merges the two cells. // This case is *extremely* unlikely, but we might as well handle it. // It can't happen at all if lgK (or maxLgK) < 26. if ( rowCol == - 1 ) { rowCol ^= ( 1 << 6 ) ; } //set the LSB of row to 0 if ( ( c << 5 ) < ( 3L * k ) ) { updateSparse ( this , rowCol ) ; } else { updateWindowed ( this , rowCol ) ; } }
Used here and for testing