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 5be4536 commit 1bc2f1cCopy full SHA for 1bc2f1c
clang-tools-extra/clang-tidy/readability/NonConstParameterCheck.cpp
@@ -119,13 +119,12 @@ void NonConstParameterCheck::addParm(const ParmVarDecl *Parm) {
119
T->getPointeeType()->isFloatingType()))
120
return;
121
122
- if (Parameters.find(Parm) != Parameters.end())
+ auto [It, Inserted] = Parameters.try_emplace(Parm);
123
+ if (!Inserted)
124
125
- ParmInfo PI;
126
- PI.IsReferenced = false;
127
- PI.CanBeConst = true;
128
- Parameters[Parm] = PI;
+ It->second.IsReferenced = false;
+ It->second.CanBeConst = true;
129
}
130
131
void NonConstParameterCheck::setReferenced(const DeclRefExpr *Ref) {
0 commit comments