micro-optimising loops by using != and pre-increment (wherever return value is not used), hint from @slowriot