Commit f325ee94 authored by Stephane Nicoll's avatar Stephane Nicoll

Merge pull request #13774 from izeye:composite-property-sources

* pr/13774:
  Remove a List creation in CompositePropertySources.iterator()
parents e6ea28de 4314dc29
...@@ -19,7 +19,6 @@ package org.springframework.boot.context.properties; ...@@ -19,7 +19,6 @@ package org.springframework.boot.context.properties;
import java.util.Arrays; import java.util.Arrays;
import java.util.Iterator; import java.util.Iterator;
import java.util.List; import java.util.List;
import java.util.stream.Collectors;
import java.util.stream.StreamSupport; import java.util.stream.StreamSupport;
import org.springframework.core.env.PropertySource; import org.springframework.core.env.PropertySource;
...@@ -44,7 +43,7 @@ final class CompositePropertySources implements PropertySources { ...@@ -44,7 +43,7 @@ final class CompositePropertySources implements PropertySources {
public Iterator<PropertySource<?>> iterator() { public Iterator<PropertySource<?>> iterator() {
return this.propertySources.stream() return this.propertySources.stream()
.flatMap((sources) -> StreamSupport.stream(sources.spliterator(), false)) .flatMap((sources) -> StreamSupport.stream(sources.spliterator(), false))
.collect(Collectors.toList()).iterator(); .iterator();
} }
@Override @Override
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment