Avoid unnecessary copy of query match list

ResultSet.toList() is defined to return a mutable list belonging to
the caller.

Change-Id: I466346fa1196cc3b201743927412ca80e5fc5e80
Signed-off-by: Jonathan Nieder <jrn@google.com>
This commit is contained in:
Jonathan Nieder 2013-09-13 15:32:31 -07:00
parent 569f8dca84
commit 8820b348a2

View File

@ -261,7 +261,7 @@ public class QueryProcessor {
List<List<ChangeData>> out = Lists.newArrayListWithCapacity(cnt);
for (int i = 0; i < cnt; i++) {
List<ChangeData> results = Lists.newArrayList(matches.get(i).toList());
List<ChangeData> results = matches.get(i).toList();
Collections.sort(results, sortkeyAfter != null ? cmpAfter : cmpBefore);
if (results.size() > maxLimit) {
moreResults = true;