Skip to content

Commit

Permalink
fix a bug in Tasked
Browse files Browse the repository at this point in the history
  • Loading branch information
idealvin committed Jul 7, 2022
1 parent d44e39b commit a0ecc7b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/tasked.cc
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,9 @@ void TaskedImpl::loop() {
++i;
} else {
co::del(task);
if (i != _tasks.size() - 1) _tasks[i] = _tasks.pop_back();
if (i != _tasks.size() - 1) _tasks[i] = _tasks.back();
// remove the tail task, don't ++i here.
_tasks.pop_back();
}
} else {
++i;
Expand Down

0 comments on commit a0ecc7b

Please sign in to comment.