[clang] [AST] Avoid repeated hash lookups (NFC) (PR #109603)
Kazu Hirata via cfe-commits
cfe-commits at lists.llvm.org
Sun Sep 22 21:06:49 PDT 2024
https://github.com/kazutakahirata created https://github.com/llvm/llvm-project/pull/109603
None
>From 6d29a8a0d011a13a9ac17fa4bf53523cfc70992d Mon Sep 17 00:00:00 2001
From: Kazu Hirata <kazu at google.com>
Date: Sun, 22 Sep 2024 07:54:30 -0700
Subject: [PATCH] [AST] Avoid repeated hash lookups (NFC)
---
clang/lib/AST/ASTContext.cpp | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/clang/lib/AST/ASTContext.cpp b/clang/lib/AST/ASTContext.cpp
index 8bd5abf2bf9643..fd8aa8de79b49f 100644
--- a/clang/lib/AST/ASTContext.cpp
+++ b/clang/lib/AST/ASTContext.cpp
@@ -12587,8 +12587,7 @@ void ASTContext::forEachMultiversionedFunctionVersion(
FD->getDeclContext()->getRedeclContext()->lookup(FD->getDeclName())) {
FunctionDecl *CurFD = CurDecl->getAsFunction()->getMostRecentDecl();
if (CurFD && hasSameType(CurFD->getType(), FD->getType()) &&
- !SeenDecls.contains(CurFD)) {
- SeenDecls.insert(CurFD);
+ SeenDecls.insert(CurFD).second) {
Pred(CurFD);
}
}
More information about the cfe-commits
mailing list