Make SigSpec::is_fully_zero use chunk iterator

This commit is contained in:
Robert O'Callahan 2025-10-28 12:36:47 +00:00
parent a7ac396fd9
commit ddd04e13e0
1 changed files with 4 additions and 5 deletions

View File

@ -5450,12 +5450,11 @@ bool RTLIL::SigSpec::is_fully_zero() const
{ {
cover("kernel.rtlil.sigspec.is_fully_zero"); cover("kernel.rtlil.sigspec.is_fully_zero");
pack(); for (auto &chunk : chunks()) {
for (auto it = chunks_.begin(); it != chunks_.end(); it++) { if (chunk.width > 0 && chunk.wire != NULL)
if (it->width > 0 && it->wire != NULL)
return false; return false;
for (size_t i = 0; i < it->data.size(); i++) for (RTLIL::State d : chunk.data)
if (it->data[i] != RTLIL::State::S0) if (d != RTLIL::State::S0)
return false; return false;
} }
return true; return true;