Skip to content

Commit c911b0a

Browse files
[clang-tidy] Avoid repeated hash lookups (NFC) (#111628)
1 parent 1ad5f31 commit c911b0a

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

clang-tools-extra/clang-tidy/cppcoreguidelines/ProTypeMemberInitCheck.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -474,10 +474,8 @@ void ProTypeMemberInitCheck::checkMissingMemberInitializer(
474474
// It only includes fields that have not been fixed
475475
SmallPtrSet<const FieldDecl *, 16> AllFieldsToInit;
476476
forEachField(ClassDecl, FieldsToInit, [&](const FieldDecl *F) {
477-
if (!HasRecordClassMemberSet.contains(F)) {
477+
if (HasRecordClassMemberSet.insert(F).second)
478478
AllFieldsToInit.insert(F);
479-
HasRecordClassMemberSet.insert(F);
480-
}
481479
});
482480
if (FieldsToInit.empty())
483481
return;

0 commit comments

Comments
 (0)