What\'s the best practice for using a switch statement vs using an if statement for 30 unsigned enumerations where about 10 have an ex
switch
if
unsigned
Code for readability. If you want to know what performs better, use a profiler, as optimizations and compilers vary, and performance issues are rarely where people think they are.