pmpailis commented on code in PR #13076: URL: https://github.com/apache/lucene/pull/13076#discussion_r1479853108
########## lucene/core/src/java/org/apache/lucene/util/VectorUtil.java: ########## @@ -214,4 +214,19 @@ public static float[] checkFinite(float[] v) { } return v; } + + public static int binaryHammingDistance(byte[] a, byte[] b) { + int distance = 0, i = 0; + for (final int upperBound = a.length & ~(Long.BYTES - 1); i < upperBound; i += Long.BYTES) { + distance += + Long.bitCount( + ((long) BitUtil.VH_NATIVE_LONG.get(a, i) ^ (long) BitUtil.VH_NATIVE_LONG.get(b, i)) + & 0xFFFFFFFFFFFFFFFFL); Review Comment: Yeah, you're right - missed to update this after the initial comment. Done in 49b400bf9b9e41e7478b9cfd145e9a30afdf79c9 -- 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: issues-unsubscr...@lucene.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org For additional commands, e-mail: issues-h...@lucene.apache.org