_DS <_D*@nomail.com> wrote:
I'm currently using a switch with about 50 case statements in a
stretch of code that's parsing XML attributes. Each case is a string.
I'm told that switch statements will actually use hash tables when
number of cases is around 10 or more, so I haven't changed the code.
Just wondering if anyone knows about how that's structured internally.
It does seem a bit slow.
What exactly do you mean by the last sentence? Do you mean you've
implemented some code and it's working slowly, or that it sounds like a
slow way of doing things?
I suspect if you're really seeing something working slowly, it won't be
due to the switch statement. I very much doubt that that will be the
bottleneck.
--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet Blog:
http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too