Article View: comp.std.c
Article #5217Re: switch (expression)
From: Henry Spencer
Date: Fri, 22 Jul 1988 20:12
Date: Fri, 22 Jul 1988 20:12
11 lines
983 bytes
983 bytes
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.
Technical Details
Message-ID:
<1988Jul22.201242.8907@utzoo.uucp>Path:
arc1-ca.pugleaf.net!utzoo!henryReferences:
<1988Jul12.105547.13268@light.uucp> <14036@apple.Apple.COM> <5255@haddock.ISC.COM>Show Full Headers
Complete Article Headers
Newsgroups: comp.std.c Path: arc1-ca.pugleaf.net!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