switch (expression)
Henry Spencer
henry at utzoo.uucp
Sat Jul 23 06:12:42 AEST 1988
In article <5255 at haddock.ISC.COM> karl at haddock.ima.isc.com (Karl Heuer) writes:
>In article <14036 at apple.Apple.COM> lenoil at 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.
More information about the Comp.std.c
mailing list