Questions about function lcl_GetMergeRange sc/source/core/data/fillinfo.cxx

Julien Nabet serval2412 at yahoo.fr
Sat Dec 29 10:45:18 PST 2012


On 29/12/2012 19:31, Markus Mohrhard wrote:
> Hey,
>
>> In  function lcl_GetMergeRange sc/source/core/data/fillinfo.cxx, what's the
>> use to process "bHOver" variable in while (bVOver) ?
> It is unused. Just copy pasted code from the bHOver case.
Ok, here's the change:
https://gerrit.libreoffice.org/gitweb?p=core.git;a=commitdiff;h=26a0979711f89915508359a9804765d934631ec2
>
>> I thought about these too:
>> - declaring nOverlap before the 2 loops, it would avoid to declare it each
>> time in the else of both loops.
>> - bVOver treatment is useless in first loop, only last loop is relevant
>>
> Please don't. These two steps fall under micro-optimization. A
> compiler is in the end much better in optimizing the code than we can
> do manually so unless profiling shows that we have a performance
> problem we should write clean and easy code.
>
> Variables should be defined as late as possible and trying to optimise
> bVOver will make the code much more complicated for most likely no
> measurable gain. If you really want to improve the performance the
> right way is to take a slow operation and use callgrind to get an idea
> where to optimise at much higher level than these assignments.
Ok then

Thank you Markus for your support!

Julien


More information about the LibreOffice mailing list