This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: switch question in recog.c


On Tue, 7 Oct 2003, Zack Weinberg moaned:
> "For maximum obfuscation, the outer braces can be removed":

The most extreme example of this I've ever seen came from the
UNIX-HATERS archives, attributed to Harbison and Steele's "C: A
Reference Manual".. I'm sure that everyone looking at this will
agree that it is a nice clear and sensible micro-optimization:

  switch (x)
    default:
      if (prime(x))
        case 2: case 3: case 5: case 7:
	  process_prime(x);
      else
        case 4: case 6: case 8: case 9: case 10:
	  process_composite(x);

-- 
`If you want a vision of the future, it is a wireless broadband network
 feeding requests for foreign money-laundering assistance into a human
 temporal lobe, forever. With banner ads.' --- John M. Ford


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]