benwtrent commented on code in PR #12480: URL: https://github.com/apache/lucene/pull/12480#discussion_r1281024474
########## lucene/core/src/java/org/apache/lucene/util/hnsw/NeighborArray.java: ########## @@ -111,6 +129,12 @@ public int[] sort() { private int insertSortedInternal() { Review Comment: This obviates the need for any additional structures, if `score==-1` calculate via the method provided to `sort()`. Though it probably won't be `BiFunction<Integer, Integer, Float>` but instead a `Function<Integer, Float>` as only the caller will know which is the "current" node for the neighbor array. Or even better, a custom functional interface that works on native values `int -> float` this way we don't box the integer and scoring results unnecessarily. -- 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