From acd3cae526cf21cb8e51df56c55ee54e22dbc7ae Mon Sep 17 00:00:00 2001 From: Robert O'Callahan Date: Thu, 9 Oct 2025 02:06:16 +0000 Subject: [PATCH] Make rtlil.cc use `SigSpecConstIterator` instead of `SigSpec::operator[] const` --- kernel/rtlil.cc | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/kernel/rtlil.cc b/kernel/rtlil.cc index 3212bf2e0..7394b6b5a 100644 --- a/kernel/rtlil.cc +++ b/kernel/rtlil.cc @@ -2972,11 +2972,14 @@ void RTLIL::Module::connect(const RTLIL::SigSig &conn) // ignore all attempts to assign constants to other constants if (conn.first.has_const()) { RTLIL::SigSig new_conn; - for (int i = 0; i < GetSize(conn.first); i++) - if (conn.first[i].wire) { - new_conn.first.append(conn.first[i]); - new_conn.second.append(conn.second[i]); + RTLIL::SigSpecConstIterator second_it = conn.second.begin(); + for (auto &first_bit : conn.first) { + if (first_bit.wire) { + new_conn.first.append(first_bit); + new_conn.second.append(*second_it); } + ++second_it; + } if (GetSize(new_conn.first)) connect(new_conn); return;