Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Copy link

Copilot AI Nov 24, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
while (perField != null) {
if (perField.invertState != null) {
fieldsToFlush.put(perField.fieldInfo.name, perField.termsHashPerField);
Expand Down
Loading