Merge pull request #575 from taksoidet/master

Change stream in FAQ
This commit is contained in:
Ruben Bermudez 2019-04-03 01:34:28 +01:00 committed by GitHub
commit d20cf9d4bd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -22,9 +22,7 @@ public PhotoSize getPhoto(Update update) {
// We fetch the bigger photo
return photos.stream()
.sorted(Comparator.comparing(PhotoSize::getFileSize).reversed())
.findFirst()
.orElse(null);
.max(Comparator.comparing(PhotoSize::getFileSize)).orElse(null);
}
// Return null if not found