4 ms·
Is `for i in eachindex(X)` really any worse? You can still do math on i, it avoids issues with OffsetArrays, and it might even be clearer why you're iterating.
by mattkrause 4y ago
Is `for i in eachindex(X)` really any worse?
You can still do math on i, it avoids issues with OffsetArrays, and it might even be clearer why you're iterating. It requires that the array type support linear indexing, but so does doing anything sensible with X[i] and X[i-1].