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(
806806
807807const Stmt *
808808FunctionParmMutationAnalyzer::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+
812813 // To handle call A -> call B -> call A. Assume parameters of A is not mutated
813814 // before analyzing parameters of A. Then when analyzing the second "call A",
814815 // FunctionParmMutationAnalyzer can use this memoized value to avoid infinite
815816 // 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);
820818}
821819
822820} // namespace clang
You can’t perform that action at this time.
0 commit comments