[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [libvirt] [PATCH] 1/1: implement usb and pci hot attach in AppArmor driver



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


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]