06.01.2018, 13:23
admantis code doesn't avoid those checks its similar to what you doing now only difference is there is an extra overhead for the function. Solving this logically would be better solution as SyS said which reduces the "checks" to only one.