Improve performance of "AggregationServiceImpl.createYearMap()".
This commit is contained in:
parent
a40c1b3e44
commit
63c9caaf96
|
@ -81,11 +81,8 @@ public class AggregationServiceImpl implements AggregationService {
|
|||
|
||||
private Map<String, List<AggregationInfo>> createYearMap(List<AggregationInfo> aggregationHistory) {
|
||||
|
||||
aggregationHistory = aggregationHistory.stream()
|
||||
.sorted(Comparator.comparing(AggregationInfo::getDate).reversed())
|
||||
.collect(Collectors.toList());
|
||||
|
||||
return aggregationHistory.stream()
|
||||
.sorted(Comparator.comparing(AggregationInfo::getDate).reversed())
|
||||
.collect(Collectors.groupingBy(item -> getYear(item.getDate())));
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue