Skip to content

Commit 1add318

Browse files
[IR] Avoid repeated hash lookups (NFC) (#138430)
1 parent 55fa7e1 commit 1add318

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

llvm/lib/IR/DroppedVariableStats.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,8 +117,7 @@ void DroppedVariableStats::removeVarFromAllSets(VarID Var, const Function *F) {
117117
bool DroppedVariableStats::isScopeChildOfOrEqualTo(const DIScope *Scope,
118118
const DIScope *DbgValScope) {
119119
while (Scope != nullptr) {
120-
if (VisitedScope.find(Scope) == VisitedScope.end()) {
121-
VisitedScope.insert(Scope);
120+
if (VisitedScope.insert(Scope).second) {
122121
if (Scope == DbgValScope) {
123122
VisitedScope.clear();
124123
return true;

0 commit comments

Comments
 (0)