Simplify ArrayList calling addAll() immediately

Closes gh-15033
pull/16246/head
Nooheat 6 years ago committed by Stephane Nicoll
parent 62782e5d86
commit 8380031039

@ -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);
} }

Loading…
Cancel
Save