File tree Expand file tree Collapse file tree 1 file changed +5
-7
lines changed Expand file tree Collapse file tree 1 file changed +5
-7
lines changed Original file line number Diff line number Diff line change @@ -806,17 +806,15 @@ FunctionParmMutationAnalyzer::FunctionParmMutationAnalyzer(
806
806
807
807
const Stmt *
808
808
FunctionParmMutationAnalyzer::findMutation (const ParmVarDecl *Parm) {
809
- const auto Memoized = Results.find (Parm);
810
- if (Memoized != Results.end ())
811
- return Memoized->second ;
809
+ auto [Place, Inserted] = Results.try_emplace (Parm);
810
+ if (!Inserted)
811
+ return Place->second ;
812
+
812
813
// To handle call A -> call B -> call A. Assume parameters of A is not mutated
813
814
// before analyzing parameters of A. Then when analyzing the second "call A",
814
815
// FunctionParmMutationAnalyzer can use this memoized value to avoid infinite
815
816
// recursion.
816
- Results[Parm] = nullptr ;
817
- if (const Stmt *S = BodyAnalyzer.findMutation (Parm))
818
- return Results[Parm] = S;
819
- return Results[Parm];
817
+ return Place->second = BodyAnalyzer.findMutation (Parm);
820
818
}
821
819
822
820
} // namespace clang
You can’t perform that action at this time.
0 commit comments