Copilot commented on code in PR #15447:
URL: https://github.com/apache/lucene/pull/15447#discussion_r2556802499
##########
lucene/core/src/java/org/apache/lucene/index/IndexingChain.java:
##########
@@ -320,8 +320,7 @@ Sorter.DocMap flush(SegmentWriteState state) throws
IOException {
t0 = System.nanoTime();
Map<String, TermsHashPerField> fieldsToFlush = new HashMap<>();
- for (int i = 0; i < fieldHash.length; i++) {
- PerField perField = fieldHash[i];
+ for (PerField perField : fieldHash) {
Review Comment:
While this refactoring is valid, there are other identical loop patterns
over `fieldHash` in the same file (e.g., in `writePoints()` at line 371 and
`writeDocValues()` at line 409) that still use the indexed for-loop style. For
consistency, consider refactoring those loops to use for-each as well, or keep
all of them in the same style.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]