Minor simplification

`.sorted(Comparator.reverseOrder()).findFirst()`
can be replaced with `max(Comparator.naturalOrder()`
master
jvoisin 6 years ago
parent def5f854fb
commit 3202a1086d
  1. 2
      airsonic-main/src/main/java/org/airsonic/player/service/VersionService.java

@ -257,7 +257,7 @@ public class VersionService {
Predicate<Version> finalVersionPredicate = version -> !version.isPreview();
Optional<Version> betaV = unsortedTags.stream().map(convertToVersion).sorted(Comparator.reverseOrder()).findFirst();
Optional<Version> betaV = unsortedTags.stream().map(convertToVersion).max(Comparator.naturalOrder());
Optional<Version> finalV = unsortedTags.stream().map(convertToVersion).sorted(Comparator.reverseOrder()).filter(finalVersionPredicate).findFirst();
LOG.debug("Got {} for beta version", betaV);

Loading…
Cancel
Save