lkml.org 
[lkml]   [2003]   [Apr]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] 2.4.21-rc1 pointless IDE noise reduction
On Thu, 24 Apr 2003, Richard B. Johnson wrote:


> > Two alternatives:
> >
> > (a) !!(x & 0x400)
> >
> > (b) (x & 0x400) >> 10
> >
>
> I meant return ((foo & MASK) && 1);
>
> Try it, you'll like it! No shifts, no jumps.

Sorry, I still find !!(foo & MASK) easier to read, because !! is only used
to convert to boolean. Sort of a "boolean cast" in effect. It jumps out at
you what is intended.

Anyway, a matter of taste, both generate jumpless code.

--
bill davidsen <davidsen@tmr.com>
CTO, TMR Associates, Inc
Doing interesting things with little computers since 1979.

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

\
 
 \ /
  Last update: 2005-03-22 13:35    [W:0.035 / U:1.052 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site