This is definitely faster than the function pointer solution.
This is still faster than the function pointer solution, and neater.