From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=0.2 required=5.0 tests=BAYES_00,INVALID_MSGID, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,bfcca4c8eac384ab X-Google-Attributes: gid103376,public From: Stephen Leake Subject: Re: style/efficiency question Date: 1997/10/27 Message-ID: <3455060F.7774@gsfc.nasa.gov>#1/1 X-Deja-AN: 286120580 References: <3454B885.2352@pseserv3.fw.hac.com> Reply-To: Stephen.Leake@gsfc.nasa.gov Organization: NASA Goddard Space Flight Center -- Greenbelt, Maryland USA Newsgroups: comp.lang.ada Date: 1997-10-27T00:00:00+00:00 List-Id: W. Wesley Groleau x4923 wrote: > > Does anyone have a clear recent (1992 or later) example of a situation > where it was not possible to generate a CASE statement that was more > efficient than an IF/THEN/ELSIF/... ? Do you mean time efficient or space efficient? gcc uses if/then/else for case statements with small numbers of choices. Certainly if there are only two cases, an if/then/else is likely to be both more efficient in both time and space. If the case choices are sparsely distributed, you either build a big sparse jump table (space inefficient), or use a compressed table of some sort (time inefficient). -- - Stephe