mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 15:24:43 +02:00
8269130: Replace usages of Collection.toArray() with Collection.toArray(T[]) to avoid redundant array copying
Reviewed-by: mullan, serb
This commit is contained in:
parent
2b05fae155
commit
35b399aca8
8 changed files with 16 additions and 70 deletions
|
@ -653,14 +653,7 @@ public final class Security {
|
|||
if (candidates == null || candidates.isEmpty())
|
||||
return null;
|
||||
|
||||
Object[] candidatesArray = candidates.toArray();
|
||||
Provider[] result = new Provider[candidatesArray.length];
|
||||
|
||||
for (int i = 0; i < result.length; i++) {
|
||||
result[i] = (Provider)candidatesArray[i];
|
||||
}
|
||||
|
||||
return result;
|
||||
return candidates.toArray(new Provider[0]);
|
||||
}
|
||||
|
||||
// Map containing cached Spi Class objects of the specified type
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue