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   [email protected]    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

--
libvir-list mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/libvir-list

Reply via email to