I\'ve seen answers here for specific languages, about switches with more than 5 cases being optimized with jump tables to guarantee constant access time for any case. Is
This is what the compiler will do for you. In case of GCC it will use a jump table.