On 10/01/2010 07:17 AM, Eric Blake wrote:
On 09/30/2010 03:07 PM, Eric Blake wrote:
>> + if (arg == 'F')
>> + ctl->append = true;
>> + else
>> + ctl->append = false;
>
> Maybe it's me, but stylistically, I like ?: for these uses:
> ctl->append = arg == 'F';
Hmm - I mentioned liking ?:, then used something even shorter :)
To clarify: when I see 'if (simple_cond) a=b; else a=c;', I generally
turn it into 'a=(simple_cond)?b:c', but I also find 'bool_cond ? true :
false' to be overkill when 'bool_cond' does just as well.
You write perl too don't you? :)