Remove unnecessary sort in writeFieldUpdates (#12273)

* Update ReadersAndUpdates.java

Reduce unnecessary sort in writeFieldUpdates

* Update ReadersAndUpdates.java

precommit import
This commit is contained in:
luyuncheng 2023-11-02 20:25:06 +08:00 committed by GitHub
parent 5f1c726807
commit 96b5edd3bb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 0 additions and 4 deletions

View File

@ -18,8 +18,6 @@ package org.apache.lucene.index;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
@ -555,8 +553,6 @@ final class ReadersAndUpdates {
FieldInfos fieldInfos = null;
boolean any = false;
for (List<DocValuesFieldUpdates> updates : pendingDVUpdates.values()) {
// Sort by increasing delGen:
Collections.sort(updates, Comparator.comparingLong(a -> a.delGen));
for (DocValuesFieldUpdates update : updates) {
if (update.delGen <= maxDelGen && update.any()) {
any = true;