Use stable sort for photo sizes to keep "i" the last.

GitOrigin-RevId: 7feab3e73a3a03bc9fd3a0e76e05ab4cbb0f10d2
This commit is contained in:
levlam 2020-10-12 10:17:02 +03:00
parent fb1307ff60
commit 4da9f9d334

View File

@ -578,7 +578,7 @@ static vector<td_api::object_ptr<td_api::photoSize>> get_photo_sizes_object(File
auto sizes = transform(photo_sizes, [file_manager](const PhotoSize &photo_size) {
return get_photo_size_object(file_manager, &photo_size);
});
std::sort(sizes.begin(), sizes.end(), [](const auto &lhs, const auto &rhs) {
std::stable_sort(sizes.begin(), sizes.end(), [](const auto &lhs, const auto &rhs) {
if (lhs->photo_->expected_size_ != rhs->photo_->expected_size_) {
return lhs->photo_->expected_size_ < rhs->photo_->expected_size_;
}