Re: A pettiness question.

From: Steven Rostedt
Date: Thu Sep 22 2005 - 07:23:30 EST



On Thu, 22 Sep 2005, Helge Hafting wrote:

> That one looks good for if-tests and such. But if you need
> a 0 or 1 for adding to a counter, then
>
> a += !!x;
>
> looks much better than
>
> a += (x != 0);
>

Actually I prefer:

a += (x == '-'-'-'?'-'-'-':'/'/'/');

:)


-- Steve

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/