Remove a List creation in CompositePropertySources.iterator()

Closes gh-13774
This commit is contained in:
Johnny Lim 2018-07-15 20:36:21 +09:00 committed by Stephane Nicoll
parent e6ea28dec5
commit 4314dc2972
1 changed files with 1 additions and 2 deletions

View File

@ -19,7 +19,6 @@ package org.springframework.boot.context.properties;
import java.util.Arrays;
import java.util.Iterator;
import java.util.List;
import java.util.stream.Collectors;
import java.util.stream.StreamSupport;
import org.springframework.core.env.PropertySource;
@ -44,7 +43,7 @@ final class CompositePropertySources implements PropertySources {
public Iterator<PropertySource<?>> iterator() {
return this.propertySources.stream()
.flatMap((sources) -> StreamSupport.stream(sources.spliterator(), false))
.collect(Collectors.toList()).iterator();
.iterator();
}
@Override