Skip to content

Apache Lucene open-source search software

LUCENE-3892: Re-use ForUtil#computeIterations to compute MAX_SATA_SIZE.

Adrien Grand06d982378374
diff --git a/lucene/core/src/java/org/apache/lucene/codecs/block/ForUtil.java b/lucene/core/src/java/org/apache/lucene/codecs/block/ForUtil.java
index 30e9faecd86..b403876eef6 100644
--- a/lucene/core/src/java/org/apache/lucene/codecs/block/ForUtil.java
+++ b/lucene/core/src/java/org/apache/lucene/codecs/block/ForUtil.java
@@ -63,7 +63,7 @@ final class ForUtil {
continue;
}
final PackedInts.Decoder decoder = PackedInts.getDecoder(format, version, bpv);
- final int iterations = (int) Math.ceil((float) BLOCK_SIZE / decoder.valueCount());
+ final int iterations = computeIterations(decoder);
maxDataSize = Math.max(maxDataSize, iterations * decoder.valueCount());
}
}