mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-01 22:29:13 +00:00
LibWeb: Only auto-reschedule HTML::EventLoop when there are runnables
HTML::EventLoop tries to reschedule itself when there are more tasks in any of its queues, but let's not do it if none of them are runnable.
This commit is contained in:
@@ -33,4 +33,13 @@ OwnPtr<Task> TaskQueue::take_first_runnable()
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
bool TaskQueue::has_runnable_tasks() const
|
||||
{
|
||||
for (auto& task : m_tasks) {
|
||||
if (task->is_runnable())
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user