Path: utzoo!attcan!uunet!seismo!sundc!pitstop!sun!gorodish!guy
From: guy@gorodish.Sun.COM (Guy Harris)
Newsgroups: comp.windows.x
Subject: Re: xterm/charproc.c
Message-ID: <58279@sun.uucp>
Date: 28 Jun 88 20:32:30 GMT
References: <8806250517.AA20251@sim.ardent.com>
Sender: news@sun.uucp
Lines: 10

> In VTparse(), the main switch looks at CASE_PRINT (ordinary printable
> characters) last. I think it's pretty obvious that cursor control
> sequences would be in the minority of characters parsed so why not
> put this case at the top of the loop?

Because any reasonable C compiler should be able to detect that this is a
"dense" case statement and generate equally efficient code regardless of the
order of the "case" statements (that is, it should generate a range check
followed by an indexed jump of some sort).  Our 68K and SPARC compilers, at
least, will do this; if yours don't, complain to your compiler people.