You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@lucene.apache.org by GitBox <gi...@apache.org> on 2020/02/17 09:39:41 UTC

[GitHub] [lucene-solr] jpountz commented on a change in pull request #1263: LUCENE-9228: Sort dv updates by terms by applying

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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org