Minor refactor to hasLeadingZeros

really minor change to the logic here. Might as well use the stdlib.