[Patch] Removed repeated calls in for loops in swnewtable.cxx

Matteo Casalin matteo.casalin at gmx.com
Mon Jul 9 09:05:39 PDT 2012


Hi Jesso,

--------------------------------------------------
Jesso Murugan <developer.jesso at gmail.com> wrote:
(09/07/2012 16:33)

> Hi Matteo,
> 
> >    just a minor hint from my side: in the original code nBox was
> >    incremented only when "pBox == rBoxes[nBox]", while in the
> >    new one it happens unconditionally.
> 
> Sorry for over looking that.
> 
> >  I don't know if this could be an issue or not.
> 
> I tested by re building and putting a breakpoint in this function,
> stepping line by line. Everything was working fine, but, its
> better to be cautious as I could have missed an edge case.

Don't worry, your code could be correct, I just stumbled on that 
difference and wanted to raise a flag to possibly help the reviewer of
your patch. Personally, without too much insight on that code, I think
you made a nice optimization :)

> >   To preserve the original behaviour a single conditional
> >   if ( nBox < nBoxCnt && pBox == rBoxes[nBox] )
> >   {
> >   could be used.
> 
> Should I send a new patch? or will the reviewers make the change
> before pushing?

Sorry, I really don't know which is the preferred way to proceed for 
such short patches.

> - Jesso Clarence

Thanks for you contribution
Matteo Casalin


More information about the LibreOffice mailing list