For more than a few cases in the switch:
If the case values are dense (such as just the integers from 0 to 9), the compiler will turn it into a jump table.
If too sparse for jump table, then typically will be turned into a binary search tree.
If the case values are dense (such as just the integers from 0 to 9), the compiler will turn it into a jump table.
If too sparse for jump table, then typically will be turned into a binary search tree.
No comments yet.