From c92ec3d81c292e4cc114d17b190f59c960d02ab7 Mon Sep 17 00:00:00 2001 From: Kazu Hirata Date: Tue, 1 Oct 2024 07:48:09 -0700 Subject: [PATCH] [DebugInfo] Avoid repeated hash lookups (NFC) (#110620) --- llvm/lib/DebugInfo/LogicalView/Core/LVCompare.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/llvm/lib/DebugInfo/LogicalView/Core/LVCompare.cpp b/llvm/lib/DebugInfo/LogicalView/Core/LVCompare.cpp index 3ed0de14f93f07..5673ea7c2cd230 100644 --- a/llvm/lib/DebugInfo/LogicalView/Core/LVCompare.cpp +++ b/llvm/lib/DebugInfo/LogicalView/Core/LVCompare.cpp @@ -312,8 +312,9 @@ Error LVCompare::execute(LVReader *ReferenceReader, LVReader *TargetReader) { // We need to find an insertion point in the reference scopes tree. Parent = Element->getParentScope(); - if (ScopeLinks.find(Parent) != ScopeLinks.end()) { - LVScope *InsertionPoint = ScopeLinks[Parent]; + auto It = ScopeLinks.find(Parent); + if (It != ScopeLinks.end()) { + LVScope *InsertionPoint = It->second; LLVM_DEBUG({ dbgs() << "Inserted at: " << hexSquareString(InsertionPoint->getOffset()) << "\n";