Polishing contribution
Closes gh-34783
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2024 the original author or authors.
|
||||
* Copyright 2002-2025 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -451,11 +451,10 @@ final class HierarchicalUriComponents extends UriComponents {
|
||||
UriTemplateVariables queryVariables = new QueryUriTemplateVariables(variables);
|
||||
this.queryParams.forEach((key, values) -> {
|
||||
String name = expandUriComponent(key, queryVariables, this.variableEncoder);
|
||||
List<String> expandedValues = result.getOrDefault(name, new ArrayList<>(values.size()));
|
||||
List<String> expandedValues = result.computeIfAbsent(name, k -> new ArrayList<>(values.size()));
|
||||
for (String value : values) {
|
||||
expandedValues.add(expandUriComponent(value, queryVariables, this.variableEncoder));
|
||||
}
|
||||
result.put(name, expandedValues);
|
||||
});
|
||||
return CollectionUtils.unmodifiableMultiValueMap(result);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user