[clang-tidy] Avoid repeated map lookups (NFC) (#127167)
This commit is contained in:
parent
5be4536d09
commit
1bc2f1c83f
@ -119,13 +119,12 @@ void NonConstParameterCheck::addParm(const ParmVarDecl *Parm) {
|
||||
T->getPointeeType()->isFloatingType()))
|
||||
return;
|
||||
|
||||
if (Parameters.find(Parm) != Parameters.end())
|
||||
auto [It, Inserted] = Parameters.try_emplace(Parm);
|
||||
if (!Inserted)
|
||||
return;
|
||||
|
||||
ParmInfo PI;
|
||||
PI.IsReferenced = false;
|
||||
PI.CanBeConst = true;
|
||||
Parameters[Parm] = PI;
|
||||
It->second.IsReferenced = false;
|
||||
It->second.CanBeConst = true;
|
||||
}
|
||||
|
||||
void NonConstParameterCheck::setReferenced(const DeclRefExpr *Ref) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user