summaryrefslogtreecommitdiff
path: root/idlc/source/astscope.cxx
diff options
context:
space:
mode:
authorJulien Nabet <serval2412@yahoo.fr>2018-03-18 10:34:42 +0100
committerJulien Nabet <serval2412@yahoo.fr>2018-03-18 11:33:16 +0100
commit1e3a5bb9e92aea074d7350ccde0dae5c123e885d (patch)
tree1244921df6b85b0e7ba81e74043a72251be5070f /idlc/source/astscope.cxx
parent2980e65d9728cfee73c1c49d64e19af50f756521 (diff)
Use for-range loops in hwpfilter, i18n*, idl* and io
Change-Id: I980464162b73ed9ee0a09acbca1b9050af8d1027 Reviewed-on: https://gerrit.libreoffice.org/51492 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Diffstat (limited to 'idlc/source/astscope.cxx')
-rw-r--r--idlc/source/astscope.cxx20
1 files changed, 5 insertions, 15 deletions
diff --git a/idlc/source/astscope.cxx b/idlc/source/astscope.cxx
index 86c150fa718f..5fd9d5339d68 100644
--- a/idlc/source/astscope.cxx
+++ b/idlc/source/astscope.cxx
@@ -196,15 +196,10 @@ AstDeclaration* AstScope::lookupByName(const OString& scopedName)
AstDeclaration* AstScope::lookupByNameLocal(const OString& name) const
{
- DeclList::const_iterator iter(m_declarations.begin());
- DeclList::const_iterator end(m_declarations.end());
-
- while ( iter != end )
+ for (auto const& declaration : m_declarations)
{
- AstDeclaration* pDecl = *iter;
- if ( pDecl->getLocalName() == name )
- return pDecl;
- ++iter;
+ if ( declaration->getLocalName() == name )
+ return declaration;
}
return nullptr;
}
@@ -223,20 +218,15 @@ AstDeclaration* AstScope::lookupInInherited(const OString& scopedName) const
}
// OK, loop through inherited interfaces. Stop when you find it
- AstInterface::InheritedInterfaces::const_iterator iter(
- pInterface->getAllInheritedInterfaces().begin());
- AstInterface::InheritedInterfaces::const_iterator end(
- pInterface->getAllInheritedInterfaces().end());
- while ( iter != end )
+ for (auto const& elem : pInterface->getAllInheritedInterfaces())
{
- AstInterface const * resolved = iter->getResolved();
+ AstInterface const * resolved = elem.getResolved();
AstDeclaration* pDecl = resolved->lookupByNameLocal(scopedName);
if ( pDecl )
return pDecl;
pDecl = resolved->lookupInInherited(scopedName);
if ( pDecl )
return pDecl;
- ++iter;
}
// Not found
return nullptr;