From 4314dc29728109dbba38c13e82f1badf8d902f6f Mon Sep 17 00:00:00 2001 From: Johnny Lim Date: Sun, 15 Jul 2018 20:36:21 +0900 Subject: [PATCH] Remove a List creation in CompositePropertySources.iterator() Closes gh-13774 --- .../boot/context/properties/CompositePropertySources.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/CompositePropertySources.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/CompositePropertySources.java index b7e416430f..e0a1d1e21d 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/CompositePropertySources.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/CompositePropertySources.java @@ -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> iterator() { return this.propertySources.stream() .flatMap((sources) -> StreamSupport.stream(sources.spliterator(), false)) - .collect(Collectors.toList()).iterator(); + .iterator(); } @Override