Change stream
This commit is contained in:
parent
b099cb6f4e
commit
935b75d685
@ -22,9 +22,7 @@ public PhotoSize getPhoto(Update update) {
|
|||||||
|
|
||||||
// We fetch the bigger photo
|
// We fetch the bigger photo
|
||||||
return photos.stream()
|
return photos.stream()
|
||||||
.sorted(Comparator.comparing(PhotoSize::getFileSize).reversed())
|
.max(Comparator.comparing(PhotoSize::getFileSize)).get();
|
||||||
.findFirst()
|
|
||||||
.orElse(null);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Return null if not found
|
// Return null if not found
|
||||||
|
Loading…
Reference in New Issue
Block a user