This is just a curiosity question. How is a switch implemented in
watcom? Is it in linear time or constant time?
I'm sure all kind of optimization is done, but my simple brain really
thinks of two ways of doing it.
linear: basically resolves down to a bunch of ifs
constant: a hash is done on the value, and then a 'goto' array is
used to jump to the correct 'case' label.
I suppose the effectiveness of either method is based on the number of
cases, how 'continuous' the cases are, and the 'hash' function.
Thanks for the enlightenment,
Yamin