
30 Sep
2010
30 Sep
'10
5:17 p.m.
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. -- Eric Blake eblake@redhat.com +1-801-349-2682 Libvirt virtualization library http://libvirt.org