4 ms·
The switch jumps directly to the case labels, skipping the valid_command_message call. At least that's the concept, but you better know what your compiler makes
by ifdefdebug 10y ago
The switch jumps directly to the case labels, skipping the valid_command_message call. At least that's the concept, but you better know what your compiler makes out of it.
So this might be useful if you want the jump table performance now on the known values, but you suspect that in the future some maintainer might add more values to the enums and forget about the switch, because maybe the enums are hidden in some header file far away.