projects
/
platform
/
upstream
/
llvm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
aa24147
)
[Sema] Avoid double hash lookup. NFCI
author
Benjamin Kramer
<benny.kra@googlemail.com>
Fri, 30 Dec 2022 18:07:19 +0000
(19:07 +0100)
committer
Benjamin Kramer
<benny.kra@googlemail.com>
Fri, 30 Dec 2022 18:25:38 +0000
(19:25 +0100)
clang/lib/Sema/SemaLookup.cpp
patch
|
blob
|
history
diff --git
a/clang/lib/Sema/SemaLookup.cpp
b/clang/lib/Sema/SemaLookup.cpp
index
c73acf1
..
97b3c97
100644
(file)
--- a/
clang/lib/Sema/SemaLookup.cpp
+++ b/
clang/lib/Sema/SemaLookup.cpp
@@
-1623,10
+1623,8
@@
hasAcceptableDefaultArgument(Sema &S, const ParmDecl *D,
if (!D->hasDefaultArgument())
return false;
- llvm::SmallDenseSet<const ParmDecl *, 4> Visited;
- while (D && !Visited.count(D)) {
- Visited.insert(D);
-
+ llvm::SmallPtrSet<const ParmDecl *, 4> Visited;
+ while (D && Visited.insert(D).second) {
auto &DefaultArg = D->getDefaultArgStorage();
if (!DefaultArg.isInherited() && S.isAcceptable(D, Kind))
return true;