2009-12-04 UPDATE: For profiling results on a number of the suggestions posted here, see below!
Consider the following very
You can get a mild speed-up by ordering the codes according to which ones are most used.
But I agree with Cletus: the best speed-up I can think of would be to use a hash map with plenty of room (so that there are no collisions.)