From 41b6c0cb9fefb5dfab77930652c29939f9b89edd Mon Sep 17 00:00:00 2001 From: Robert O'Callahan Date: Mon, 1 Sep 2025 03:26:40 +0000 Subject: [PATCH] Make CellTypes methods take IdString by reference to avoid refcount churn --- kernel/celltypes.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/kernel/celltypes.h b/kernel/celltypes.h index 11640c25f..f08a695e9 100644 --- a/kernel/celltypes.h +++ b/kernel/celltypes.h @@ -303,24 +303,24 @@ struct CellTypes cell_types.clear(); } - bool cell_known(RTLIL::IdString type) const + bool cell_known(const RTLIL::IdString &type) const { return cell_types.count(type) != 0; } - bool cell_output(RTLIL::IdString type, RTLIL::IdString port) const + bool cell_output(const RTLIL::IdString &type, const RTLIL::IdString &port) const { auto it = cell_types.find(type); return it != cell_types.end() && it->second.outputs.count(port) != 0; } - bool cell_input(RTLIL::IdString type, RTLIL::IdString port) const + bool cell_input(const RTLIL::IdString &type, const RTLIL::IdString &port) const { auto it = cell_types.find(type); return it != cell_types.end() && it->second.inputs.count(port) != 0; } - bool cell_evaluable(RTLIL::IdString type) const + bool cell_evaluable(const RTLIL::IdString &type) const { auto it = cell_types.find(type); return it != cell_types.end() && it->second.is_evaluable;