diff --git a/tdactor/td/actor/impl/ActorInfo-decl.h b/tdactor/td/actor/impl/ActorInfo-decl.h index 9af073f02..6726c0408 100644 --- a/tdactor/td/actor/impl/ActorInfo-decl.h +++ b/tdactor/td/actor/impl/ActorInfo-decl.h @@ -108,8 +108,6 @@ class ActorInfo final bool need_context() const; bool need_start_up() const; - bool must_wait() const; - private: Deleter deleter_ = Deleter::None; bool need_context_ = true; diff --git a/tdactor/td/actor/impl/ActorInfo.h b/tdactor/td/actor/impl/ActorInfo.h index 16e1cfe77..f734f4c0b 100644 --- a/tdactor/td/actor/impl/ActorInfo.h +++ b/tdactor/td/actor/impl/ActorInfo.h @@ -60,10 +60,6 @@ inline bool ActorInfo::need_start_up() const { return need_start_up_; } -inline bool ActorInfo::must_wait() const { - return !mailbox_.empty(); -} - inline void ActorInfo::on_actor_moved(Actor *actor_new_ptr) { actor_ = actor_new_ptr; } diff --git a/tdactor/td/actor/impl/Scheduler.h b/tdactor/td/actor/impl/Scheduler.h index 298c3a05c..e41e31374 100644 --- a/tdactor/td/actor/impl/Scheduler.h +++ b/tdactor/td/actor/impl/Scheduler.h @@ -206,13 +206,9 @@ void Scheduler::send_impl(const ActorId<> &actor_id, const RunFuncT &run_func, c CHECK(has_guard_ || !on_current_sched); if (likely(send_type == ActorSendType::Immediate && on_current_sched && !actor_info->is_running() && - !actor_info->must_wait())) { // run immediately - if (likely(actor_info->mailbox_.empty())) { - EventGuard guard(this, actor_info); - run_func(actor_info); - } else { - flush_mailbox(actor_info, &run_func, &event_func); - } + actor_info->mailbox_.empty())) { // run immediately + EventGuard guard(this, actor_info); + run_func(actor_info); } else { if (on_current_sched) { add_to_mailbox(actor_info, event_func());