[Libreoffice] [Libreoffice-commits] .: writerperfect/source

Stephan Bergmann sbergman at redhat.com
Tue Oct 25 00:16:23 PDT 2011


On 10/25/2011 04:04 AM, Kevin Hunter wrote:
> At 9:48pm -0400 Mon, 24 Oct 2011, Kevin Hunter wrote:
>> At 7:24pm -0400 Mon, 24 Oct 2011, Fridrich Štrba wrote:
>>> for (std::map<WPXString, FontStyle *, ltstr>::const_iterator iter =
>>> mHash.begin();
>>> - iter != mHash.end(); ++iter)
>>> + iter != mHash.end(); iter++)
>>
>> Err, in terms of coding style, is a pre to post increment operator
>> merely a whitespace change? I seem to recall a message or two on the
>> subject but I'm having a difficult time tracking them down just now.
>> About 8 months ago, perhaps?
>
> Kevin: open mouth, insert foot. I apologize. Just perusing commits,
> should've kept going. I take it the pre to post is needed to "fix the
> build".

This looks more like "fix the build" reverted more than was really 
necessary in this case.

In general, and if the expression's value is not used, prefix 
increment/decrement is preferable to postfix, as the former conceptually 
avoids creation of a temporary that makes the old, unmodified value 
available as the expression's value.

That said, you see both forms with more-or-less similar frequency in the 
wild.

-Stephan


More information about the LibreOffice mailing list