Newsgroups: comp.std.c
Path: utzoo!henry
From: henry@utzoo.uucp (Henry Spencer)
Subject: Re: switch (expression)
Message-ID: <1988Jul22.201242.8907@utzoo.uucp>
Organization: U of Toronto Zoology
References: <1988Jul12.105547.13268@light.uucp> <14036@apple.Apple.COM> <5255@haddock.ISC.COM>
Date: Fri, 22 Jul 88 20:12:42 GMT

In article <5255@haddock.ISC.COM> karl@haddock.ima.isc.com (Karl Heuer) writes:
>In article <14036@apple.Apple.COM> lenoil@apple.apple.com.UUCP (Robert Lenoil) writes:
>>It's really inefficient to do int comparisons when the actual thing you're
>>CASEing on is a byte.  I think that the type of the case labels should be
>>whatever the type of the switch expression...
>
>This is a Quality of Implementation issue...

Moreover, it is a machine-specific optimization.  Some machines are very
clumsy at byte handling; it is not at all impossible that on some of them
byte comparisons are considerably *less* efficient than int comparisons.
