On Sat, 2009-05-30 at 16:05 -0400, Hubert Figuiere wrote:
> Just some style comments, for the record
>
> On 05/30/2009 03:54 PM, cvs@abisource.com wrote:
> > + rem = ((rem> 0)? rem-- : 0);
>
> You can make that one clearer by using if()
> This is too obfuscated, therefor unnecessary
In addition, rem is left unchanged by the above statement.
The value of rem-- is rem, with the side effect of decrementing rem by
1.
Then the value of rem-- is assigned to rem - leaving it unchanged.
With --rem instead of rem-- the statement works as expected.
And now - a note about style:
I actually find
rem = (rem > 0) ? (rem - 1) : 0;
to be as readable as
if (rem > 0) rem--;
or
if (rem > 0) {
rem--;
}
--- Omer
-- The brain does not use addresses. www.werner-seyfried.com My own blog is at http://www.zak.co.il/tddpirate/ My opinions, as expressed in this E-mail message, are mine alone. They do not represent the official policy of any organization with which I may be affiliated in any way. WARNING TO SPAMMERS: at http://www.zak.co.il/spamwarning.htmlReceived on Sat May 30 22:21:37 2009
This archive was generated by hypermail 2.1.8 : Sat May 30 2009 - 22:21:37 CEST