aboutsummaryrefslogtreecommitdiffstats
path: root/backends
diff options
context:
space:
mode:
authorEddie Hung <eddie@fpgeh.com>2019-12-30 18:26:35 -0800
committerEddie Hung <eddie@fpgeh.com>2019-12-30 18:26:35 -0800
commit65baefecd39b3be641b9a6be350d2ae83854cacc (patch)
tree9c5a5879469a1de262280d6f268aa332607a5839 /backends
parente2bbe33a88c11b89e5a011c43d5a9c6b4623f9a7 (diff)
downloadyosys-65baefecd39b3be641b9a6be350d2ae83854cacc.tar.gz
yosys-65baefecd39b3be641b9a6be350d2ae83854cacc.tar.bz2
yosys-65baefecd39b3be641b9a6be350d2ae83854cacc.zip
Rid unnecessary if
Diffstat (limited to 'backends')
-rw-r--r--backends/aiger/xaiger.cc24
1 files changed, 11 insertions, 13 deletions
diff --git a/backends/aiger/xaiger.cc b/backends/aiger/xaiger.cc
index 877e0e58a..35fb8d5dc 100644
--- a/backends/aiger/xaiger.cc
+++ b/backends/aiger/xaiger.cc
@@ -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";