We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 6f6100f commit 9c86a7eCopy full SHA for 9c86a7e
clang/lib/AST/OpenMPClause.cpp
@@ -1125,16 +1125,12 @@ unsigned OMPClauseMappableExprCommon::getComponentsTotalNumber(
1125
1126
unsigned OMPClauseMappableExprCommon::getUniqueDeclarationsTotalNumber(
1127
ArrayRef<const ValueDecl *> Declarations) {
1128
- unsigned TotalNum = 0u;
1129
- llvm::SmallPtrSet<const ValueDecl *, 8> Cache;
+ llvm::SmallPtrSet<const ValueDecl *, 8> UniqueDecls;
1130
for (const ValueDecl *D : Declarations) {
1131
const ValueDecl *VD = D ? cast<ValueDecl>(D->getCanonicalDecl()) : nullptr;
1132
- if (Cache.count(VD))
1133
- continue;
1134
- ++TotalNum;
1135
- Cache.insert(VD);
+ UniqueDecls.insert(VD);
1136
}
1137
- return TotalNum;
+ return UniqueDecls.size();
1138
1139
1140
OMPMapClause *OMPMapClause::Create(
0 commit comments