Improved sub-node selection efficiency by using two branches instead of one branch with 3 different pairs of checks.

This should boost selection speed by over 100% on average, and in the worst case by around 200%.