Mirror von
https://github.com/tkuschel/bees.git
synchronisiert 2026-10-31 04:17:48 +01: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>
Dieser Commit ist enthalten in:
1 Ursprung
c0a7533dd4
Commit
3f740d6b2d
1 Datei geändert
+1
-3
+1
-3
@@ -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();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
In neuem Issue referenzieren
Einen Benutzer sperren