Would move `length` to a variable cause any perf impact? Also I believe Rails conventions are mostly not to use `do` with `while`, similer to not using `then` with `if`.

Always great stuff @SamSaffron :+1: