From 9e6d06a871b366cc72f9a23ab45080b66a47f144 Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Mon, 3 Oct 2011 16:28:21 +0300 Subject: WaE: unreachable code, also add comment pondering what the code means --- stoc/source/inspect/introspection.cxx | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'stoc') diff --git a/stoc/source/inspect/introspection.cxx b/stoc/source/inspect/introspection.cxx index 889179cab375..36f1acce8e02 100644 --- a/stoc/source/inspect/introspection.cxx +++ b/stoc/source/inspect/introspection.cxx @@ -112,7 +112,14 @@ sal_Bool isDerivedFrom( Reference xToTestClass, Reference const Reference* 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& rxClass = pClassesArray[i]; if( xDerivedFromClass->equals( rxClass ) ) -- cgit