Apply a micro-optimization.
Flatten some branches and boost performance.