Rid unnecessary if
authorEddie Hung <eddie@fpgeh.com>
Tue, 31 Dec 2019 02:26:35 +0000 (18:26 -0800)
committerEddie Hung <eddie@fpgeh.com>
Tue, 31 Dec 2019 02:26:35 +0000 (18:26 -0800)
backends/aiger/xaiger.cc

index 877e0e58abaaec5f24bdc64794f31076b7e91509..35fb8d5dc4e2054b50246e2b65b575d36d2a5dec 100644 (file)
@@ -714,22 +714,20 @@ struct XAigerWriter
                        f.write(reinterpret_cast<const char*>(&buffer_size_be), sizeof(buffer_size_be));
                        f.write(buffer_str.data(), buffer_str.size());
 
-                       if (holes_module) {
-                               module->design->selection_stack.emplace_back(false);
-                               module->design->selection().select(holes_module);
+                       module->design->selection_stack.emplace_back(false);
+                       module->design->selection().select(holes_module);
 
-                               std::stringstream a_buffer;
-                               XAigerWriter writer(holes_module);
-                               writer.write_aiger(a_buffer, false /*ascii_mode*/);
+                       std::stringstream a_buffer;
+                       XAigerWriter writer(holes_module);
+                       writer.write_aiger(a_buffer, false /*ascii_mode*/);
 
-                               module->design->selection_stack.pop_back();
+                       module->design->selection_stack.pop_back();
 
-                               f << "a";
-                               std::string buffer_str = a_buffer.str();
-                               int32_t buffer_size_be = to_big_endian(buffer_str.size());
-                               f.write(reinterpret_cast<const char*>(&buffer_size_be), sizeof(buffer_size_be));
-                               f.write(buffer_str.data(), buffer_str.size());
-                       }
+                       f << "a";
+                       buffer_str = a_buffer.str();
+                       buffer_size_be = to_big_endian(buffer_str.size());
+                       f.write(reinterpret_cast<const char*>(&buffer_size_be), sizeof(buffer_size_be));
+                       f.write(buffer_str.data(), buffer_str.size());
                }
 
                f << "h";