Commit 9c09af0b authored by Stephane Nicoll's avatar Stephane Nicoll

Merge pull request #15033 from Nooheat

* pr/15033:
  Simplify ArrayList calling addAll() immediately
parents 62782e5d 83800310
...@@ -1304,8 +1304,7 @@ public class SpringApplication { ...@@ -1304,8 +1304,7 @@ public class SpringApplication {
} }
private static <E> Set<E> asUnmodifiableOrderedSet(Collection<E> elements) { private static <E> Set<E> asUnmodifiableOrderedSet(Collection<E> elements) {
List<E> list = new ArrayList<>(); List<E> list = new ArrayList<>(elements);
list.addAll(elements);
list.sort(AnnotationAwareOrderComparator.INSTANCE); list.sort(AnnotationAwareOrderComparator.INSTANCE);
return new LinkedHashSet<>(list); return new LinkedHashSet<>(list);
} }
......
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