Improve comment in BloomFilterIndexer.
This commit is contained in:
parent
eda601dd04
commit
2a9bdc0098
|
@ -53,7 +53,9 @@ final class BloomFilterIndexer {
|
||||||
* @see #checkPositive(int)
|
* @see #checkPositive(int)
|
||||||
*/
|
*/
|
||||||
static int getLongIndex(int bitIndex) {
|
static int getLongIndex(int bitIndex) {
|
||||||
// Use a signed shift. Any negative index will produce a negative value
|
// An integer divide by 64 is equivalent to a shift of 6 bits if the integer is positive.
|
||||||
|
// We do not explicitly check for a negative here. Instead we use a
|
||||||
|
// a signed shift. Any negative index will produce a negative value
|
||||||
// by sign-extension and if used as an index into an array it will throw an exception.
|
// by sign-extension and if used as an index into an array it will throw an exception.
|
||||||
return bitIndex >> DIVIDE_BY_64;
|
return bitIndex >> DIVIDE_BY_64;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue