mirror of https://github.com/apache/lucene.git
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;
|
||||
final long byteCount = byteCount(packedIntsVersion, valueCount, bitsPerValue);
|
||||
assert byteCount < 8L * Integer.MAX_VALUE;
|
||||
if ((byteCount % 8) == 0) {
|
||||
return (int) (byteCount / 8);
|
||||
} else {
|
||||
return (int) (byteCount / 8 + 1);
|
||||
}
|
||||
return (int) ((byteCount + 7) >>> 3);
|
||||
}
|
||||
|
||||
/** Tests whether the provided number of bits per value is supported by the format. */
|
||||
|
|
Loading…
Reference in New Issue