Clean up extraneous buffer.
authorAlberto Gonzalez <boqwxp@airmail.cc>
Sun, 19 Apr 2020 23:52:21 +0000 (23:52 +0000)
committerAlberto Gonzalez <boqwxp@airmail.cc>
Thu, 14 May 2020 20:06:54 +0000 (20:06 +0000)
passes/techmap/techmap.cc

index a915f207d7875941a5908c70045613800c054dd0..6b0957ad7bb8255d83049c5f9b2cb464c3557cb9 100644 (file)
@@ -1423,14 +1423,11 @@ struct FlattenPass : public Pass {
                                                        new_used_modules.insert(cell->type);
                        }
 
-                       std::set<RTLIL::Module *> to_remove;
-                       for (auto mod : design->modules())
+                       for (auto mod : design->modules().to_vector())
                                if (!used_modules[mod->name] && !mod->get_blackbox_attribute(worker.ignore_wb)) {
                                        log("Deleting now unused module %s.\n", log_id(mod));
-                                       to_remove.insert(mod);
+                                       design->remove(mod);
                                }
-                       for (auto mod : to_remove)
-                               design->remove(mod);
                }
 
                log_pop();