[Libreoffice-commits] .: basic/source

Michael Meeks michael at kemper.freedesktop.org
Tue May 31 06:18:57 PDT 2011


 basic/source/runtime/runtime.cxx |   11 +++--------
 1 file changed, 3 insertions(+), 8 deletions(-)

New commits:
commit c807a53f6f0ad7c54cbd89f42805d722f01d0d6a
Author: Michael Meeks <michael.meeks at novell.com>
Date:   Tue May 31 14:16:55 2011 +0100

    cleanup loop iteration to be simpler

diff --git a/basic/source/runtime/runtime.cxx b/basic/source/runtime/runtime.cxx
index d555825..a92ca12 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;
 }
 
 


More information about the Libreoffice-commits mailing list