mirror of
https://github.com/AngelAuraMC/Amethyst-Android.git
synced 2025-09-15 07:39:00 -04:00
Feat[commonapi]: pre-allocate filteredResults list
This commit is contained in:
parent
5af69bc8fb
commit
b8e3b2a6f9
@ -79,7 +79,7 @@ public class CommonApi implements ModpackApi {
|
||||
return null;
|
||||
}
|
||||
// Then build an array with all the mods
|
||||
List<ModItem[]> filteredResults = new ArrayList<>();
|
||||
ArrayList<ModItem[]> filteredResults = new ArrayList<>(results.length);
|
||||
|
||||
// Sanitize returned values
|
||||
for(SearchResult result : results) {
|
||||
@ -89,6 +89,7 @@ public class CommonApi implements ModpackApi {
|
||||
if(searchResults.length == 0) continue;
|
||||
filteredResults.add(searchResults);
|
||||
}
|
||||
filteredResults.trimToSize();
|
||||
if(Thread.interrupted()) return null;
|
||||
|
||||
ModItem[] concatenatedItems = buildFusedResponse(filteredResults);
|
||||
|
Loading…
x
Reference in New Issue
Block a user