diff --git a/elaborate.cc b/elaborate.cc index 8a9fb2514..6e9cc3cdc 100644 --- a/elaborate.cc +++ b/elaborate.cc @@ -7215,10 +7215,7 @@ Design* elaborate(listroots) // Transfer the queue to a temporary queue. list cur_queue; - while (! des->elaboration_work_list.empty()) { - cur_queue.push_back(des->elaboration_work_list.front()); - des->elaboration_work_list.pop_front(); - } + std::swap(cur_queue, des->elaboration_work_list); // Run from the temporary queue. If the temporary queue // items create new work queue items, they will show up