Skip to content

Commit 6921e24

Browse files
committed
Merge pull request #17827 from zhuzhuman978
* pr/17827: Simplify for statement with Collection copy Closes gh-17827
2 parents 6777a43 + 84eacc4 commit 6921e24

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/source/SpringIterableConfigurationPropertySource.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -115,9 +115,7 @@ private PropertyMapping[] getPropertyMappings(Cache cache) {
115115
String[] names = getPropertySource().getPropertyNames();
116116
List<PropertyMapping> mappings = new ArrayList<>(names.length * 2);
117117
for (String name : names) {
118-
for (PropertyMapping mapping : getMapper().map(name)) {
119-
mappings.add(mapping);
120-
}
118+
Collections.addAll(mappings, getMapper().map(name));
121119
}
122120
result = mappings.toArray(new PropertyMapping[0]);
123121
if (cache != null) {

0 commit comments

Comments
 (0)