aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Sema/SemaDecl.cpp
diff options
context:
space:
mode:
authorKazu Hirata <kazu@google.com>2025-01-11 13:15:50 -0800
committerGitHub <noreply@github.com>2025-01-11 13:15:50 -0800
commita56eb7c9986456ae4b492fff79c3cf18d0ef8ad3 (patch)
tree2138c2ab2aba1675623cb235784c247a41ac4c7e /clang/lib/Sema/SemaDecl.cpp
parent07ff786e39e2190449998d3af1000454dee501be (diff)
downloadllvm-a56eb7c9986456ae4b492fff79c3cf18d0ef8ad3.zip
llvm-a56eb7c9986456ae4b492fff79c3cf18d0ef8ad3.tar.gz
llvm-a56eb7c9986456ae4b492fff79c3cf18d0ef8ad3.tar.bz2
[Sema] Avoid repeated hash lookups (NFC) (#122588)
Diffstat (limited to 'clang/lib/Sema/SemaDecl.cpp')
-rw-r--r--clang/lib/Sema/SemaDecl.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp
index 8724c20..5b7275c 100644
--- a/clang/lib/Sema/SemaDecl.cpp
+++ b/clang/lib/Sema/SemaDecl.cpp
@@ -15868,8 +15868,8 @@ static void diagnoseImplicitlyRetainedSelf(Sema &S) {
llvm::DenseMap<const BlockDecl *, bool> EscapeInfo;
auto IsOrNestedInEscapingBlock = [&](const BlockDecl *BD) {
- if (EscapeInfo.count(BD))
- return EscapeInfo[BD];
+ if (auto It = EscapeInfo.find(BD); It != EscapeInfo.end())
+ return It->second;
bool R = false;
const BlockDecl *CurBD = BD;