mirror of
https://github.com/Zygo/bees.git
synced 2025-06-16 17:46:16 +02:00
task: simplify clear_queue
Simplify the loop in clear_queue because we can't be modifying a queue while we are clearing it. Signed-off-by: Zygo Blaxell <bees@furryterror.org>
This commit is contained in:
@ -254,9 +254,7 @@ namespace crucible {
|
||||
void
|
||||
TaskState::clear_queue(TaskQueue &tq)
|
||||
{
|
||||
while (!tq.empty()) {
|
||||
auto i = *tq.begin();
|
||||
tq.pop_front();
|
||||
for (auto &i : tq) {
|
||||
i->clear();
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user