From f36d21e31c863829cfe49ac21093795500733e64 Mon Sep 17 00:00:00 2001 From: Kazu Hirata Date: Sat, 8 Feb 2025 00:53:38 -0800 Subject: [PATCH] [Analysis] Avoid repeated hash lookups (NFC) --- clang/lib/Analysis/UninitializedValues.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/clang/lib/Analysis/UninitializedValues.cpp b/clang/lib/Analysis/UninitializedValues.cpp index bf2f730618650..3a052eb27a444 100644 --- a/clang/lib/Analysis/UninitializedValues.cpp +++ b/clang/lib/Analysis/UninitializedValues.cpp @@ -379,8 +379,10 @@ void ClassifyRefs::classify(const Expr *E, Class C) { } FindVarResult Var = findVar(E, DC); - if (const DeclRefExpr *DRE = Var.getDeclRefExpr()) - Classification[DRE] = std::max(Classification[DRE], C); + if (const DeclRefExpr *DRE = Var.getDeclRefExpr()) { + auto &Class = Classification[DRE]; + Class = std::max(Class, C); + } } void ClassifyRefs::VisitDeclStmt(DeclStmt *DS) {