From 379c462f82d0b91d6b40c11f9ec8248269aa84e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Povi=C5=A1er?= Date: Tue, 6 Feb 2024 10:30:35 +0100 Subject: [PATCH] opt_merge: `const auto&` where suitable --- passes/opt/opt_merge.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/passes/opt/opt_merge.cc b/passes/opt/opt_merge.cc index 91bbd9e3cf0..2b8217b668d 100644 --- a/passes/opt/opt_merge.cc +++ b/passes/opt/opt_merge.cc @@ -105,7 +105,7 @@ struct OptMergeWorker } conn_hash = mkhash_xorshift64(a.hash()) + acc; } else { - for (auto conn : cell->connections()) + for (const auto &conn : cell->connections()) if (!cell->output(conn.first)) conn_hash += mkhash_xorshift64(mkhash(conn.first.hash(), assign_map(conn.second).hash())); @@ -114,7 +114,7 @@ struct OptMergeWorker } uint64_t param_hash = 0; - for (auto &it : cell->parameters) + for (const auto &it : cell->parameters) param_hash += mkhash_xorshift64(mkhash(it.first.hash(), it.second.hash())); return conn_hash + mkhash_xorshift64(param_hash + cell->type.hash());