diff options
Diffstat (limited to 'idlc/source/astscope.cxx')
-rw-r--r-- | idlc/source/astscope.cxx | 14 |
1 files changed, 2 insertions, 12 deletions
diff --git a/idlc/source/astscope.cxx b/idlc/source/astscope.cxx index 1ddda3984458..9af691501a8a 100644 --- a/idlc/source/astscope.cxx +++ b/idlc/source/astscope.cxx @@ -85,18 +85,8 @@ AstDeclaration* AstScope::addDeclaration(AstDeclaration* pDecl) sal_uInt16 AstScope::getNodeCount(NodeType nodeType) const { - DeclList::const_iterator iter = getIteratorBegin(); - DeclList::const_iterator end = getIteratorEnd(); - sal_uInt16 count = 0; - - while ( iter != end ) - { - AstDeclaration* pDecl = *iter; - if ( pDecl->getNodeType() == nodeType ) - count++; - ++iter; - } - return count; + return static_cast<sal_uInt16>(std::count_if(getIteratorBegin(), getIteratorEnd(), + [&nodeType](const AstDeclaration* pDecl) { return pDecl->getNodeType() == nodeType; })); } AstDeclaration* AstScope::lookupByName(const OString& scopedName) |