diff options
author | Alexey Bataev <a.bataev@hotmail.com> | 2014-06-25 04:09:13 +0000 |
---|---|---|
committer | Alexey Bataev <a.bataev@hotmail.com> | 2014-06-25 04:09:13 +0000 |
commit | 14984f0ad030521d71c9c60d1439728c6ea94f17 (patch) | |
tree | b17e3f7b6fde4d50c368a82edee0a0eac444a6e3 /include | |
parent | 41c9813dabe57ee52648139b174f569395a6fb47 (diff) | |
download | clang-14984f0ad030521d71c9c60d1439728c6ea94f17.tar.gz clang-14984f0ad030521d71c9c60d1439728c6ea94f17.tar.bz2 clang-14984f0ad030521d71c9c60d1439728c6ea94f17.tar.xz |
[OPENMP] Improved code and replaced struct by lambda.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@211660 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r-- | include/clang/AST/StmtOpenMP.h | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/include/clang/AST/StmtOpenMP.h b/include/clang/AST/StmtOpenMP.h index 70a914f999..a2583dce3f 100644 --- a/include/clang/AST/StmtOpenMP.h +++ b/include/clang/AST/StmtOpenMP.h @@ -94,16 +94,17 @@ public: template <class FilterPredicate> class filtered_clause_iterator { ArrayRef<OMPClause *>::const_iterator Current; ArrayRef<OMPClause *>::const_iterator End; + FilterPredicate Pred; void SkipToNextClause() { - while (Current != End && !FilterPredicate()(*Current)) + while (Current != End && !Pred(*Current)) ++Current; } public: typedef const OMPClause *value_type; filtered_clause_iterator() : Current(), End() {} - explicit filtered_clause_iterator(ArrayRef<OMPClause *> Arr) - : Current(Arr.begin()), End(Arr.end()) { + filtered_clause_iterator(ArrayRef<OMPClause *> Arr, FilterPredicate Pred) + : Current(Arr.begin()), End(Arr.end()), Pred(Pred) { SkipToNextClause(); } value_type operator*() const { return *Current; } |