On Fri, Oct 28, 2016 at 2:17 AM, Hiltjo Posthuma <[email protected]> wrote:
>
> FWIW: I disagree. The ternary form is slightly longer but more readable.

I too disagree. I think the !! is more readable and idiomatic (either
way, at least we aren't casting to bool...).  But I am curious, does
the compiler still generate a branch for the ternary? How does the
code compare for the 3 cases? I'll play around with that later.

That being said, isurgent is being used in the traditional boolean
sense where 0 is false and non 0 is true. As such there is no need to
do either. Just having

    c->isurgent = wmh->flags & XUrgencyHint;

is fine.

emg

Reply via email to