summaryrefslogtreecommitdiff
path: root/basic
diff options
context:
space:
mode:
authorMichael Meeks <michael.meeks@novell.com>2011-05-31 14:16:55 +0100
committerMichael Meeks <michael.meeks@novell.com>2011-05-31 14:17:43 +0100
commitee6c4017da5b5a5210c0e2f1ec06e0ac49fc600b (patch)
tree2348cca6530e74218f70d60da43fee789a2a8e56 /basic
parent8ce982432a9a73ec628c8c6cff73f152bee1b57a (diff)
cleanup loop iteration to be simpler
Diffstat (limited to 'basic')
-rw-r--r--basic/source/runtime/runtime.cxx11
1 files changed, 3 insertions, 8 deletions
diff --git a/basic/source/runtime/runtime.cxx b/basic/source/runtime/runtime.cxx
index 55b7aef0abba..8e6299b6203f 100644
--- a/basic/source/runtime/runtime.cxx
+++ b/basic/source/runtime/runtime.cxx
@@ -1237,22 +1237,17 @@ void SbiRuntime::ClearForStack()
SbiForStack* SbiRuntime::FindForStackItemForCollection( class BasicCollection* pCollection )
{
- SbiForStack* pRet = NULL;
-
- SbiForStack* p = pForStk;
- while( p )
+ for (SbiForStack *p = pForStk; p; p = p->pNext)
{
SbxVariable* pVar = p->refEnd.Is() ? (SbxVariable*)p->refEnd : NULL;
if( p->eForType == FOR_EACH_COLLECTION && pVar != NULL &&
PTR_CAST(BasicCollection,pVar) == pCollection )
{
- pRet = p;
- break;
+ return p;
}
- p = p->pNext;
}
- return pRet;
+ return NULL;
}