Skip to content

Commit d5ef2c0

Browse files
[AST] Avoid repeated hash lookups (NFC) (#123285)
1 parent f5736ae commit d5ef2c0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

clang/lib/AST/VTableBuilder.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3831,8 +3831,8 @@ const VirtualBaseInfo &MicrosoftVTableContext::computeVBTableRelatedInformation(
38313831
unsigned VBTableIndex = 1 + VBI->VBTableIndices.size();
38323832
for (const auto &VB : RD->vbases()) {
38333833
const CXXRecordDecl *CurVBase = VB.getType()->getAsCXXRecordDecl();
3834-
if (!VBI->VBTableIndices.count(CurVBase))
3835-
VBI->VBTableIndices[CurVBase] = VBTableIndex++;
3834+
if (VBI->VBTableIndices.try_emplace(CurVBase, VBTableIndex).second)
3835+
++VBTableIndex;
38363836
}
38373837

38383838
return *VBI;

0 commit comments

Comments
 (0)