Skip to content

Commit 0c30052

Browse files
Remove redundant list copy in CanMatchNodeRequest (elastic#121700)
We're not mutating that list ever, so lets just use an immutable list all the way here and avoid at least one round of needless copy.
1 parent 2988109 commit 0c30052

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

server/src/main/java/org/elasticsearch/action/search/CanMatchNodeRequest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ public CanMatchNodeRequest(
136136
) {
137137
this.source = getCanMatchSource(searchRequest);
138138
this.indicesOptions = indicesOptions;
139-
this.shards = new ArrayList<>(shards);
139+
this.shards = shards;
140140
this.searchType = searchRequest.searchType();
141141
this.requestCache = searchRequest.requestCache();
142142
// If allowPartialSearchResults is unset (ie null), the cluster-level default should have been substituted

0 commit comments

Comments
 (0)