From 9d41aa8e2888577fc2a57179b8d4a9a3a4e03f59 Mon Sep 17 00:00:00 2001 From: Henner Zeller Date: Mon, 6 Jun 2022 13:50:32 -0700 Subject: [PATCH] Avoid unnecessary copy of a potential large constant value. The local variable is used just to iterate through the values, so a const reference is all we need. --- passes/fsm/fsmdata.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/passes/fsm/fsmdata.h b/passes/fsm/fsmdata.h index 4ba3b4e4f..97371efab 100644 --- a/passes/fsm/fsmdata.h +++ b/passes/fsm/fsmdata.h @@ -91,8 +91,8 @@ struct FsmData if (reset_state < 0 || reset_state >= state_num) reset_state = -1; - RTLIL::Const state_table = cell->parameters[ID::STATE_TABLE]; - RTLIL::Const trans_table = cell->parameters[ID::TRANS_TABLE]; + const RTLIL::Const &state_table = cell->parameters[ID::STATE_TABLE]; + const RTLIL::Const &trans_table = cell->parameters[ID::TRANS_TABLE]; for (int i = 0; i < state_num; i++) { RTLIL::Const state_code; -- 2.30.2