[llvm] f01d45c - [DebugInfo] Avoid repeated hash lookups (NFC) (#110620)
via llvm-commits
llvm-commits at lists.llvm.org
Tue Oct 1 07:48:12 PDT 2024
Author: Kazu Hirata
Date: 2024-10-01T07:48:09-07:00
New Revision: f01d45cf97714a8751f1712b158c34bb28ce0ce3
URL: https://github.com/llvm/llvm-project/commit/f01d45cf97714a8751f1712b158c34bb28ce0ce3
DIFF: https://github.com/llvm/llvm-project/commit/f01d45cf97714a8751f1712b158c34bb28ce0ce3.diff
LOG: [DebugInfo] Avoid repeated hash lookups (NFC) (#110620)
Added:
Modified:
llvm/lib/DebugInfo/LogicalView/Core/LVCompare.cpp
Removed:
################################################################################
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";
More information about the llvm-commits
mailing list