jpountz commented on a change in pull request #311:
URL: https://github.com/apache/lucene/pull/311#discussion_r712832329



##########
File path: 
lucene/core/src/java/org/apache/lucene/codecs/perfield/PerFieldPostingsFormat.java
##########
@@ -340,9 +342,15 @@ public FieldsReader(final SegmentReadState readState) 
throws IOException {
       this.segment = readState.segmentInfo.name;
     }
 
+    private static List<String> buildFieldList(Map<String, FieldsProducer> 
fields) {
+      List<String> fieldList = new ArrayList<>(fields.keySet());
+      fieldList.sort(null);
+      return Collections.unmodifiableList(fieldList);
+    }

Review comment:
       nit: `buildFieldList` is a bit abstract and if I was reading a call site 
of this method I'd need to look at its definition to understand what it does 
exactly. Maybe call it `createSortedCopy(Collection<String>)` instead and fix 
call sites to pass the keyset to make the code easier to read?




-- 
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

Reply via email to