Skip to content

Commit 6f6100f

Browse files
[Bitcode] Avoid repeated hash lookups (NFC) (llvm#107708)
1 parent 51d3829 commit 6f6100f

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

llvm/lib/Bitcode/Reader/MetadataLoader.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -536,9 +536,8 @@ class MetadataLoader::MetadataLoaderImpl {
536536
DenseSet<DILocalScope *> Visited;
537537
while (S && !isa<DISubprogram>(S)) {
538538
S = dyn_cast_or_null<DILocalScope>(S->getScope());
539-
if (Visited.contains(S))
539+
if (!Visited.insert(S).second)
540540
break;
541-
Visited.insert(S);
542541
}
543542
ParentSubprogram[InitialScope] = llvm::dyn_cast_or_null<DISubprogram>(S);
544543

0 commit comments

Comments
 (0)