Clean up private member usage in `passes/cmds/copy.cc`.
authorAlberto Gonzalez <boqwxp@airmail.cc>
Mon, 6 Apr 2020 08:26:10 +0000 (08:26 +0000)
committerAlberto Gonzalez <boqwxp@airmail.cc>
Mon, 6 Apr 2020 08:26:10 +0000 (08:26 +0000)
passes/cmds/copy.cc

index acd2dba5295717a37517e31c1308aabfb6ce1e3d..99f1f69cf7be387f3191a4061b5ed9aa0e1a87a7 100644 (file)
@@ -44,10 +44,10 @@ struct CopyPass : public Pass {
                std::string src_name = RTLIL::escape_id(args[1]);
                std::string trg_name = RTLIL::escape_id(args[2]);
 
-               if (design->modules_.count(src_name) == 0)
+               if (design->module(src_name) == nullptr)
                        log_cmd_error("Can't find source module %s.\n", src_name.c_str());
 
-               if (design->modules_.count(trg_name) != 0)
+               if (design->module(trg_name) != nullptr)
                        log_cmd_error("Target module name %s already exists.\n", trg_name.c_str());
 
                RTLIL::Module *new_mod = design->module(src_name)->clone();