From 47e52c387594d86e39b2ef8cdf1a4e38d7561188 Mon Sep 17 00:00:00 2001 From: Kazu Hirata Date: Thu, 27 Feb 2025 23:03:29 -0800 Subject: [PATCH] [ADT] Avoid repeated hash lookups (NFC) --- llvm/include/llvm/ADT/SCCIterator.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/llvm/include/llvm/ADT/SCCIterator.h b/llvm/include/llvm/ADT/SCCIterator.h index 3bd103c13f19f..fef8cdb748442 100644 --- a/llvm/include/llvm/ADT/SCCIterator.h +++ b/llvm/include/llvm/ADT/SCCIterator.h @@ -354,10 +354,10 @@ scc_member_iterator::scc_member_iterator( // Walk through SortedEdges to initialize the queue, instead of using NodeInfoMap // to ensure an ordered deterministic push. for (auto *Edge : SortedEdges) { - if (!NodeInfoMap[Edge->Source].Visited && - NodeInfoMap[Edge->Source].IncomingMSTEdges.empty()) { + auto &Info = NodeInfoMap[Edge->Source]; + if (!Info.Visited && Info.IncomingMSTEdges.empty()) { Queue.push(Edge->Source); - NodeInfoMap[Edge->Source].Visited = true; + Info.Visited = true; } }