1
0
mirror of https://github.com/Zygo/bees.git synced 2025-05-18 05:45:45 +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:
Zygo Blaxell 2021-12-07 00:04:34 -05:00
parent c0a7533dd4
commit 3f740d6b2d

View File

@ -254,9 +254,7 @@ namespace crucible {
void void
TaskState::clear_queue(TaskQueue &tq) TaskState::clear_queue(TaskQueue &tq)
{ {
while (!tq.empty()) { for (auto &i : tq) {
auto i = *tq.begin();
tq.pop_front();
i->clear(); i->clear();
} }
} }