mirror of
https://github.com/YosysHQ/yosys
synced 2025-11-03 13:07:58 +00:00
Avoid unnecessary copying when applying a SigMap to a SigSpec
Currently we duplicate the `SigSpec` first and then iterate over the duplicate, updating its bits. Instead just generate new bits and add them to an empty `SigSpec`.
This commit is contained in:
parent
e49f9765a2
commit
f4617104b6
1 changed files with 7 additions and 3 deletions
|
|
@ -259,10 +259,14 @@ struct SigMapView
|
|||
return bit;
|
||||
}
|
||||
|
||||
RTLIL::SigSpec operator()(RTLIL::SigSpec sig) const
|
||||
RTLIL::SigSpec operator()(const RTLIL::SigSpec &sig) const
|
||||
{
|
||||
apply(sig);
|
||||
return sig;
|
||||
RTLIL::SigSpec result;
|
||||
for (RTLIL::SigBit bit : sig) {
|
||||
apply(bit);
|
||||
result.append(bit);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
RTLIL::SigSpec operator()(RTLIL::Wire *wire) const
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue