This can be enforced by pre-commit, but correct it separately to make it easier to review.
Don't store final, failing value to the loop variable. This fix also makes for .. range a bit more efficient, as it uses less store/load pairs for the loop variable.