BAEL-3440: Remove unnecessary sorting (#8336)

This commit is contained in:
kwoyke 2019-12-13 09:57:24 +01:00 committed by Grzegorz Piwowarek
parent 339913ef05
commit 0201d9f0e7
1 changed files with 0 additions and 3 deletions

View File

@ -24,10 +24,7 @@ public class ConvertToMap {
public TreeMap<String, Book> listToSortedMap(List<Book> books) { public TreeMap<String, Book> listToSortedMap(List<Book> books) {
return books.stream() return books.stream()
.sorted(Comparator.comparing(Book::getName))
.collect(Collectors.toMap(Book::getName, Function.identity(), (o1, o2) -> o1, TreeMap::new)); .collect(Collectors.toMap(Book::getName, Function.identity(), (o1, o2) -> o1, TreeMap::new));
} }
} }