summaryrefslogtreecommitdiff
path: root/idlc
diff options
context:
space:
mode:
authorMichael Weghorn <m.weghorn@posteo.de>2015-08-22 11:58:11 +0200
committerThorsten Behrens <Thorsten.Behrens@CIB.de>2015-08-22 13:02:08 +0000
commit25accda781bc0bc79ca2e887c54ca981068bf407 (patch)
tree0f551b4f516dd289df523d71bff08a26de2c3622 /idlc
parent159bace378aefa5e48967f1e5089acef9a7f2378 (diff)
tdf#39440 reduce scope of local variables
This addresses some cppcheck warnings. Change-Id: I6ab170c4426494ab9fc53017f88e47fbfdbd9aad Reviewed-on: https://gerrit.libreoffice.org/17920 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
Diffstat (limited to 'idlc')
-rw-r--r--idlc/source/astscope.cxx6
1 files changed, 2 insertions, 4 deletions
diff --git a/idlc/source/astscope.cxx b/idlc/source/astscope.cxx
index c4a84c4d8c2e..cd8a48387496 100644
--- a/idlc/source/astscope.cxx
+++ b/idlc/source/astscope.cxx
@@ -87,12 +87,11 @@ sal_uInt16 AstScope::getNodeCount(NodeType nodeType)
{
DeclList::const_iterator iter = getIteratorBegin();
DeclList::const_iterator end = getIteratorEnd();
- AstDeclaration* pDecl = NULL;
sal_uInt16 count = 0;
while ( iter != end )
{
- pDecl = *iter;
+ AstDeclaration* pDecl = *iter;
if ( pDecl->getNodeType() == nodeType )
count++;
++iter;
@@ -199,11 +198,10 @@ AstDeclaration* AstScope::lookupByNameLocal(const OString& name) const
{
DeclList::const_iterator iter(m_declarations.begin());
DeclList::const_iterator end(m_declarations.end());
- AstDeclaration* pDecl = NULL;
while ( iter != end )
{
- pDecl = *iter;
+ AstDeclaration* pDecl = *iter;
if ( pDecl->getLocalName() == name )
return pDecl;
++iter;