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 bf3deb1 commit 28733edCopy full SHA for 28733ed
clang/lib/Analysis/ExprMutationAnalyzer.cpp
@@ -231,12 +231,11 @@ ExprMutationAnalyzer::Analyzer::findPointeeMutation(const Decl *Dec) {
231
const Stmt *ExprMutationAnalyzer::Analyzer::findMutationMemoized(
232
const Expr *Exp, llvm::ArrayRef<MutationFinder> Finders,
233
Memoized::ResultMap &MemoizedResults) {
234
- const auto Memoized = MemoizedResults.find(Exp);
235
- if (Memoized != MemoizedResults.end())
+ auto [Memoized, Inserted] = MemoizedResults.try_emplace(Exp);
+ if (!Inserted)
236
return Memoized->second;
237
238
// Assume Exp is not mutated before analyzing Exp.
239
- MemoizedResults[Exp] = nullptr;
240
if (isUnevaluated(Exp))
241
return nullptr;
242
0 commit comments