But then I'd have to convert my switch to a series of ifs since the
pointers to the literals are computed during runtime.
I know switches are not great with sparse constant spaces such as when
using hashes (i.e. only a few tenths of used values from 2^32 possible
values) but I like the compiler doing the binary search for me (gcc
does) instead of having to figure it out myself. I'm also experimenting
hashing the hash (just shifts and xors, nothing fancy or costly) to make
the space dense enough so the switch will (hopefully) become a goto
table + one if for each case to see if it's really a match. Better than
the hard-coded binary tree...
Cheers,
Andre