Integer#times
for a simple loop which iterates a fixed number of times RB-ST1035for
loops which iterate a constant number of times, using a Range
literal and #each
,
can be done more readably using Integer#times
.
This check only applies if the block takes no parameters.
(1..5).each { }
5.times { }