[Libreoffice-commits] .: stoc/source

Tor Lillqvist tml at kemper.freedesktop.org
Mon Oct 3 06:33:54 PDT 2011


 stoc/source/inspect/introspection.cxx |    9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

New commits:
commit 9e6d06a871b366cc72f9a23ab45080b66a47f144
Author: Tor Lillqvist <tlillqvist at suse.com>
Date:   Mon Oct 3 16:28:21 2011 +0300

    WaE: unreachable code, also add comment pondering what the code means

diff --git a/stoc/source/inspect/introspection.cxx b/stoc/source/inspect/introspection.cxx
index 889179c..36f1acc 100644
--- a/stoc/source/inspect/introspection.cxx
+++ b/stoc/source/inspect/introspection.cxx
@@ -112,7 +112,14 @@ sal_Bool isDerivedFrom( Reference<XIdlClass> xToTestClass, Reference<XIdlClass>
     const Reference<XIdlClass>* pClassesArray = aClassesSeq.getConstArray();
     sal_Int32 nSuperClassCount = aClassesSeq.getLength();
     sal_Int32 i;
-    for( i = 0 ; i < nSuperClassCount ; i++ )
+    for( i = 0 ;
+         i < nSuperClassCount ;
+         /* No "increment" expression needed as the body always
+          * returns, and in fact MSVC warns about unreachable code if
+          * we include one. On the other hand, what's the point in
+          * using a for loop here then if all we ever will look at is
+          * pClassesArray[0] ?
+          */ )
     {
         const Reference<XIdlClass>& rxClass = pClassesArray[i];
         if( xDerivedFromClass->equals( rxClass ) )


More information about the Libreoffice-commits mailing list