From a1f022416bad464a2ec8b27b24710c4226502420 Mon Sep 17 00:00:00 2001 From: Kazu Hirata Date: Sat, 3 May 2025 17:54:50 -0700 Subject: [PATCH] [IR] Avoid repeated hash lookups (NFC) --- llvm/lib/IR/DroppedVariableStats.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/llvm/lib/IR/DroppedVariableStats.cpp b/llvm/lib/IR/DroppedVariableStats.cpp index 9e221bf585f1a..b8c0dd6e7b1dc 100644 --- a/llvm/lib/IR/DroppedVariableStats.cpp +++ b/llvm/lib/IR/DroppedVariableStats.cpp @@ -117,8 +117,7 @@ void DroppedVariableStats::removeVarFromAllSets(VarID Var, const Function *F) { bool DroppedVariableStats::isScopeChildOfOrEqualTo(const DIScope *Scope, const DIScope *DbgValScope) { while (Scope != nullptr) { - if (VisitedScope.find(Scope) == VisitedScope.end()) { - VisitedScope.insert(Scope); + if (VisitedScope.insert(Scope).second) { if (Scope == DbgValScope) { VisitedScope.clear(); return true;