rmuir commented on a change in pull request #357:
URL: https://github.com/apache/lucene/pull/357#discussion_r723259603
##########
File path: lucene/core/src/java/org/apache/lucene/util/ArrayUtil.java
##########
@@ -694,4 +694,81 @@ public static int compareUnsigned4(byte[] a, int aOffset,
byte[] b, int bOffset)
return Integer.compareUnsigned(
(int) BitUtil.VH_BE_INT.get(a, aOffset), (int)
BitUtil.VH_BE_INT.get(b, bOffset));
}
+
+ /**
+ * Return a comparator that computes the common prefix length across the
next {@code numBytes} of
+ * the provided arrays.
+ */
+ public static ByteArrayComparator getPrefixLengthComparator(int numBytes) {
Review comment:
Thanks! If we later need them for something outside of this package
(e.g. a points query), then we can look at putting them in a more generic place.
--
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]