Skip to content

Commit acd3cae

Browse files
committed
Make rtlil.cc use SigSpecConstIterator instead of SigSpec::operator[] const
1 parent adf34bb commit acd3cae

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

kernel/rtlil.cc

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2972,11 +2972,14 @@ void RTLIL::Module::connect(const RTLIL::SigSig &conn)
29722972
// ignore all attempts to assign constants to other constants
29732973
if (conn.first.has_const()) {
29742974
RTLIL::SigSig new_conn;
2975-
for (int i = 0; i < GetSize(conn.first); i++)
2976-
if (conn.first[i].wire) {
2977-
new_conn.first.append(conn.first[i]);
2978-
new_conn.second.append(conn.second[i]);
2975+
RTLIL::SigSpecConstIterator second_it = conn.second.begin();
2976+
for (auto &first_bit : conn.first) {
2977+
if (first_bit.wire) {
2978+
new_conn.first.append(first_bit);
2979+
new_conn.second.append(*second_it);
29792980
}
2981+
++second_it;
2982+
}
29802983
if (GetSize(new_conn.first))
29812984
connect(new_conn);
29822985
return;

0 commit comments

Comments
 (0)