mirror of
https://github.com/apache/lucene.git
synced 2025-02-08 19:15:06 +00:00
Simplify PackedInts#longCount (#13256)
This commit is contained in:
parent
07d3be59af
commit
9c9f934a7c
@ -149,11 +149,7 @@ public class PackedInts {
|
|||||||
assert bitsPerValue >= 0 && bitsPerValue <= 64 : bitsPerValue;
|
assert bitsPerValue >= 0 && bitsPerValue <= 64 : bitsPerValue;
|
||||||
final long byteCount = byteCount(packedIntsVersion, valueCount, bitsPerValue);
|
final long byteCount = byteCount(packedIntsVersion, valueCount, bitsPerValue);
|
||||||
assert byteCount < 8L * Integer.MAX_VALUE;
|
assert byteCount < 8L * Integer.MAX_VALUE;
|
||||||
if ((byteCount % 8) == 0) {
|
return (int) ((byteCount + 7) >>> 3);
|
||||||
return (int) (byteCount / 8);
|
|
||||||
} else {
|
|
||||||
return (int) (byteCount / 8 + 1);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Tests whether the provided number of bits per value is supported by the format. */
|
/** Tests whether the provided number of bits per value is supported by the format. */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user