Simplify conditions in lambda.

This commit is contained in:
levlam 2023-08-27 01:20:51 +03:00
parent 1dcd78f1ed
commit 4b3750cefe

View File

@ -2135,15 +2135,13 @@ void NotificationManager::remove_notification_group(NotificationGroupId group_id
}); });
} else { } else {
remove_added_notifications_from_pending_updates( remove_added_notifications_from_pending_updates(
group_id, [max_object_id](const td_api::object_ptr<td_api::notification> &notification) { group_id, [max_id = max_object_id.get()](const td_api::object_ptr<td_api::notification> &notification) {
const auto *type = notification->type_.get(); const auto *type = notification->type_.get();
switch (type->get_id()) { switch (type->get_id()) {
case td_api::notificationTypeNewMessage::ID: case td_api::notificationTypeNewMessage::ID:
return static_cast<const td_api::notificationTypeNewMessage *>(type)->message_->id_ <= return static_cast<const td_api::notificationTypeNewMessage *>(type)->message_->id_ <= max_id;
max_object_id.get();
case td_api::notificationTypeNewPushMessage::ID: case td_api::notificationTypeNewPushMessage::ID:
return static_cast<const td_api::notificationTypeNewPushMessage *>(type)->message_id_ <= return static_cast<const td_api::notificationTypeNewPushMessage *>(type)->message_id_ <= max_id;
max_object_id.get();
default: default:
return false; return false;
} }