Immediately exit UpdatesManager::process_updates if there are no updates to process.
This commit is contained in:
parent
faaf8f10f9
commit
9ef9751f5f
@ -2027,14 +2027,15 @@ void UpdatesManager::add_pending_qts_update(tl_object_ptr<telegram_api::Update>
|
||||
|
||||
void UpdatesManager::process_updates(vector<tl_object_ptr<telegram_api::Update>> &&updates, bool force_apply,
|
||||
Promise<Unit> &&promise) {
|
||||
tl_object_ptr<telegram_api::updatePtsChanged> update_pts_changed;
|
||||
|
||||
int32 update_count = 0;
|
||||
for (auto &update : updates) {
|
||||
if (update != nullptr) {
|
||||
update_count++;
|
||||
}
|
||||
}
|
||||
if (update_count == 0) {
|
||||
return promise.set_value(Unit());
|
||||
}
|
||||
|
||||
MultiPromiseActorSafe mpas{"OnProcessUpdatesMultiPromiseActor"};
|
||||
Promise<Unit> lock;
|
||||
@ -2070,6 +2071,8 @@ void UpdatesManager::process_updates(vector<tl_object_ptr<telegram_api::Update>>
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
tl_object_ptr<telegram_api::updatePtsChanged> update_pts_changed;
|
||||
for (auto &update : updates) {
|
||||
if (update != nullptr) {
|
||||
// process updateNewChannelMessage first
|
||||
|
Loading…
Reference in New Issue
Block a user