Alex Rivera | Logout

Switch statement with huge number of cases

Asked 2012-09-12T07:15:42.587
14

What happens if the switch has more than 5000 case. What are the drawbacks and how we can replace it with something faster?

Note: I am not expecting to use array to store cases as it's the same.

Edit
Report

1 Answer

3

Try to use Dictionary class with Delegate values. At least it makes code a little bit more readable.

answered 2012-09-12T07:20:48.647

Your Answer