[Libreoffice] [PATCH] some changes for better performance, writer.
Norbert Thiebaud
nthiebaud at gmail.com
Sat Jan 8 12:00:17 PST 2011
On Mon, Jan 9, 2006 at 11:09 PM, Kayo Hamid
<kayo.hamid at gekkolinux.com.br> wrote:
> Sending for review.
I' confused:
- sal_Int32 nCount = xAcc->getAccessibleChildCount();
-
- for( sal_Int32 i=0; i < nCount; i++ )
+ const sal_Int32 nCount = xAcc->getAccessibleChildCount();
+ sal_Int32 i = 0;
+
+ while(i < nCount)
{
- if( xAcc->getAccessibleChild( i ) == xThis )
- return i;
+ if( xAcc->getAccessibleChild( i ) == xThis )
+ return i;
+ i++;
}
+
Unless I'm really dense: this simply change a for() loop into a
while() loop doing exactly the same thing
Why is it supposed to improve performance ?
as for the rest:
Did you really measure that turning a passed-by-value scalar (which
caller's value cannot be modified by the callee, by definition) into a
const passed by value
scalar, has _actually_ any performance impact ?
Norbert
> revol_
>
> _______________________________________________
> LibreOffice mailing list
> LibreOffice at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/libreoffice
>
>
More information about the LibreOffice
mailing list