iverase commented on code in PR #16387:
URL: https://github.com/apache/lucene/pull/16387#discussion_r3577407752
##########
lucene/core/src/java/org/apache/lucene/index/SlowCompositeCodecReaderWrapper.java:
##########
@@ -681,110 +680,98 @@ public boolean moveToChild() throws IOException {
@Override
public byte[] getMinPackedValue() {
- try {
- byte[] minPackedValue = null;
- for (PointValuesSub sub : values) {
- if (minPackedValue == null) {
- minPackedValue = sub.sub.getMinPackedValue().clone();
- } else {
- byte[] leafMinPackedValue = sub.sub.getMinPackedValue();
- int numIndexDimensions = sub.sub.getNumIndexDimensions();
- int numBytesPerDimension = sub.sub.getBytesPerDimension();
- ArrayUtil.ByteArrayComparator comparator =
- ArrayUtil.getUnsignedComparator(numBytesPerDimension);
- for (int i = 0; i < numIndexDimensions; ++i) {
- if (comparator.compare(
- leafMinPackedValue,
- i * numBytesPerDimension,
- minPackedValue,
- i * numBytesPerDimension)
- < 0) {
- System.arraycopy(
+ byte[] minPackedValue = null;
+ for (PointValuesSub sub : values) {
+ if (minPackedValue == null) {
+ minPackedValue = sub.sub.getMinPackedValue().clone();
+ } else {
+ byte[] leafMinPackedValue = sub.sub.getMinPackedValue();
+ int numIndexDimensions = sub.sub.getNumIndexDimensions();
+ int numBytesPerDimension = sub.sub.getBytesPerDimension();
+ ArrayUtil.ByteArrayComparator comparator =
+ ArrayUtil.getUnsignedComparator(numBytesPerDimension);
+ for (int i = 0; i < numIndexDimensions; ++i) {
+ if (comparator.compare(
leafMinPackedValue,
i * numBytesPerDimension,
minPackedValue,
- i * numBytesPerDimension,
- numBytesPerDimension);
- }
+ i * numBytesPerDimension)
+ < 0) {
+ System.arraycopy(
+ leafMinPackedValue,
+ i * numBytesPerDimension,
+ minPackedValue,
+ i * numBytesPerDimension,
+ numBytesPerDimension);
}
}
}
- return minPackedValue;
- } catch (IOException e) {
- throw new UncheckedIOException(e);
}
+ return minPackedValue;
}
@Override
public byte[] getMaxPackedValue() {
- try {
- byte[] maxPackedValue = null;
- for (PointValuesSub sub : values) {
- if (maxPackedValue == null) {
- maxPackedValue = sub.sub.getMaxPackedValue().clone();
- } else {
- byte[] leafMinPackedValue = sub.sub.getMaxPackedValue();
- int numIndexDimensions = sub.sub.getNumIndexDimensions();
- int numBytesPerDimension = sub.sub.getBytesPerDimension();
- ArrayUtil.ByteArrayComparator comparator =
- ArrayUtil.getUnsignedComparator(numBytesPerDimension);
- for (int i = 0; i < numIndexDimensions; ++i) {
- if (comparator.compare(
- leafMinPackedValue,
- i * numBytesPerDimension,
- maxPackedValue,
- i * numBytesPerDimension)
- > 0) {
- System.arraycopy(
+ byte[] maxPackedValue = null;
+ for (PointValuesSub sub : values) {
+ if (maxPackedValue == null) {
+ maxPackedValue = sub.sub.getMaxPackedValue().clone();
+ } else {
+ byte[] leafMinPackedValue = sub.sub.getMaxPackedValue();
+ int numIndexDimensions = sub.sub.getNumIndexDimensions();
+ int numBytesPerDimension = sub.sub.getBytesPerDimension();
+ ArrayUtil.ByteArrayComparator comparator =
+ ArrayUtil.getUnsignedComparator(numBytesPerDimension);
+ for (int i = 0; i < numIndexDimensions; ++i) {
+ if (comparator.compare(
leafMinPackedValue,
i * numBytesPerDimension,
maxPackedValue,
- i * numBytesPerDimension,
- numBytesPerDimension);
- }
+ i * numBytesPerDimension)
+ > 0) {
+ System.arraycopy(
+ leafMinPackedValue,
+ i * numBytesPerDimension,
+ maxPackedValue,
+ i * numBytesPerDimension,
+ numBytesPerDimension);
}
}
}
- return maxPackedValue;
- } catch (IOException e) {
Review Comment:
❤️
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]