Skip to content

Commit

Permalink
Reverted changes as need to think more on this
Browse files Browse the repository at this point in the history
Signed-off-by: expani <[email protected]>
  • Loading branch information
expani committed Dec 27, 2024
1 parent 54ac23e commit 598b9af
Showing 1 changed file with 4 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,12 @@ public LeafFieldComparator getLeafComparator(LeafReaderContext context) throws I

@Override
protected long missingValueAsComparableLong() {
return unSignedToSignedLong(missingValue);
return missingValue.longValue();
}

@Override
protected long sortableBytesToLong(byte[] bytes) {
return unSignedToSignedLong(NumericUtils.sortableBytesToBigInt(bytes, 0, BigIntegerPoint.BYTES));
return NumericUtils.sortableBytesToBigInt(bytes, 0, BigIntegerPoint.BYTES).longValue();
}

/** Leaf comparator for {@link UnsignedLongComparator} that provides skipping functionality */
Expand Down Expand Up @@ -100,19 +100,12 @@ public void copy(int slot, int doc) throws IOException {

@Override
protected long bottomAsComparableLong() {
return unSignedToSignedLong(bottom);
return bottom.longValue();
}

@Override
protected long topAsComparableLong() {
return unSignedToSignedLong(topValue);
return topValue.longValue();
}
}

/**
* Converts unsigned long to signed the same as java.lang.{@link Long#compareUnsigned(long, long)}
*/
private static long unSignedToSignedLong(BigInteger value) {
return value.longValue() + Long.MIN_VALUE;
}
}

0 comments on commit 598b9af

Please sign in to comment.