We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b192f20 commit 571354eCopy full SHA for 571354e
clang-tools-extra/clang-tidy/misc/ConfusableIdentifierCheck.cpp
@@ -137,11 +137,11 @@ static bool mayShadow(const NamedDecl *ND0,
137
const ConfusableIdentifierCheck::ContextInfo *
138
ConfusableIdentifierCheck::getContextInfo(const DeclContext *DC) {
139
const DeclContext *PrimaryContext = DC->getPrimaryContext();
140
- auto It = ContextInfos.find(PrimaryContext);
141
- if (It != ContextInfos.end())
+ auto [It, Inserted] = ContextInfos.try_emplace(PrimaryContext);
+ if (!Inserted)
142
return &It->second;
143
144
- ContextInfo &Info = ContextInfos[PrimaryContext];
+ ContextInfo &Info = It->second;
145
Info.PrimaryContext = PrimaryContext;
146
Info.NonTransparentContext = PrimaryContext;
147
0 commit comments