diff options
author | Michael Meeks <michael.meeks@novell.com> | 2011-05-31 14:16:55 +0100 |
---|---|---|
committer | Michael Meeks <michael.meeks@novell.com> | 2011-05-31 14:17:43 +0100 |
commit | ee6c4017da5b5a5210c0e2f1ec06e0ac49fc600b (patch) | |
tree | 2348cca6530e74218f70d60da43fee789a2a8e56 /basic | |
parent | 8ce982432a9a73ec628c8c6cff73f152bee1b57a (diff) |
cleanup loop iteration to be simpler
Diffstat (limited to 'basic')
-rw-r--r-- | basic/source/runtime/runtime.cxx | 11 |
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; } |