3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2026-04-26 13:53:34 +00:00

Pass IdString by value instead of by const reference.

When IdString refcounting was expensive, it made sense to pass it by const reference
instead of by value, to avoid refcount churn. Now that IdString is not refcounted,
it's slightly more efficient to pass it by value.
This commit is contained in:
Robert O'Callahan 2025-12-22 01:52:59 +00:00
parent 64a933d77b
commit 46cb05c471
15 changed files with 108 additions and 108 deletions

View file

@ -305,18 +305,18 @@ struct CellTypes
cell_types.clear();
}
bool cell_known(const RTLIL::IdString &type) const
bool cell_known(RTLIL::IdString type) const
{
return cell_types.count(type) != 0;
}
bool cell_output(const RTLIL::IdString &type, const RTLIL::IdString &port) const
bool cell_output(RTLIL::IdString type, RTLIL::IdString port) const
{
auto it = cell_types.find(type);
return it != cell_types.end() && it->second.outputs.count(port) != 0;
}
bool cell_input(const RTLIL::IdString &type, const RTLIL::IdString &port) const
bool cell_input(RTLIL::IdString type, RTLIL::IdString port) const
{
auto it = cell_types.find(type);
return it != cell_types.end() && it->second.inputs.count(port) != 0;
@ -332,7 +332,7 @@ struct CellTypes
return RTLIL::PortDir(is_input + is_output * 2);
}
bool cell_evaluable(const RTLIL::IdString &type) const
bool cell_evaluable(RTLIL::IdString type) const
{
auto it = cell_types.find(type);
return it != cell_types.end() && it->second.is_evaluable;