Skip to content

Commit 5ceb78d

Browse files
kazutakahirataDanielCChen
authored andcommitted
[AST] Avoid repeated set lookups (NFC) (llvm#112155)
1 parent 1869085 commit 5ceb78d

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

clang/lib/AST/InheritViz.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,12 +63,11 @@ void InheritanceHierarchyWriter::WriteNode(QualType Type, bool FromVirtual) {
6363
QualType CanonType = Context.getCanonicalType(Type);
6464

6565
if (FromVirtual) {
66-
if (KnownVirtualBases.find(CanonType) != KnownVirtualBases.end())
66+
if (!KnownVirtualBases.insert(CanonType).second)
6767
return;
6868

6969
// We haven't seen this virtual base before, so display it and
7070
// its bases.
71-
KnownVirtualBases.insert(CanonType);
7271
}
7372

7473
// Declare the node itself.

0 commit comments

Comments
 (0)