Initialize ArrayList with exact size in HttpHeaders
This commit is contained in:
parent
f60bec986f
commit
0d10d4beee
|
|
@ -593,7 +593,7 @@ public class HttpHeaders implements MultiValueMap<String, String>, Serializable
|
|||
String value = getFirst(ACCESS_CONTROL_ALLOW_METHODS);
|
||||
if (value != null) {
|
||||
String[] tokens = StringUtils.tokenizeToStringArray(value, ",");
|
||||
List<HttpMethod> result = new ArrayList<>();
|
||||
List<HttpMethod> result = new ArrayList<>(tokens.length);
|
||||
for (String token : tokens) {
|
||||
HttpMethod method = HttpMethod.valueOf(token);
|
||||
result.add(method);
|
||||
|
|
|
|||
Loading…
Reference in New Issue