Skip to content

Commit 77f0d1f

Browse files
authored
Add list initialCapacity in FirstPassGroupingCollector#getTopGroups. (#14777)
1 parent 3404496 commit 77f0d1f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lucene/grouping/src/java/org/apache/lucene/search/grouping/FirstPassGroupingCollector.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ public Collection<SearchGroup<T>> getTopGroups(int groupOffset) throws IOExcepti
131131
buildSortedSet();
132132
}
133133

134-
final Collection<SearchGroup<T>> result = new ArrayList<>();
134+
final Collection<SearchGroup<T>> result = new ArrayList<>(orderedGroups.size() - groupOffset);
135135
int upto = 0;
136136
final int sortFieldCount = comparators.length;
137137
for (CollectedSearchGroup<T> group : orderedGroups) {

0 commit comments

Comments
 (0)