|
|
|
|
|
by hermitdev
1456 days ago
|
|
I'm also dubious on the claim the switch statement is O(n). It might be in a pathological worst case, but you can pretty much bet the compiler is going to transform it into a jump table or other optimized execution (maybe a computed jump). Especially when the cases are contiguous like this... I agree that a benchmark is warranted, or at least a comparison of the generated assembly (at different optimization levels). |
|