Best of all - this means he does a function call to do a simple multiplication. Even if the switch would speed this up a lot (and it won't at all), it will still be slower (unless the compiler inlines it automatically, which is less probable with a longer function).
If this was done as a macro or inline, it would be naive. This way, it's simply stupid.