jpountz commented on a change in pull request #1263: LUCENE-9228: Sort dv updates by terms by applying URL: https://github.com/apache/lucene-solr/pull/1263#discussion_r380049439
########## File path: lucene/core/src/java/org/apache/lucene/util/BytesRefArray.java ########## @@ -185,20 +186,48 @@ public BytesRefIterator iterator() { */ @Override public BytesRefIterator iterator(final Comparator<BytesRef> comp) { - final BytesRefBuilder spare = new BytesRefBuilder(); - final BytesRef result = new BytesRef(); + return iteratorProvider(comp).get(); + } + + /** + * Prefer using either {@link #iterator()} or {@link #iterator(Comparator)}. + * This method is only useful if multiple iterators with a non-null {@link Comparator} + * are requires as it avoids sorting the array multiple times. Review comment: ```suggestion * are required as it avoids sorting the array multiple times. ``` ---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org For additional commands, e-mail: issues-h...@lucene.apache.org