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

Eric Blake eblake at redhat.com
Thu Sep 30 21:17:38 UTC 2010


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 at redhat.com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org




More information about the libvir-list mailing list