move to modern indexing style
check #722 too
Compiler should infer inbounds when using each index
after some testing, zip() is as slow as eachindex(a, b) without @inbounds
I suggest keep using eachindex(a, b) but also add @inbounds
on the master branch of Julia, the @inbounds is inferred from for i in eachindex(a, b) as expected.
and I don't understand the CI error on nightly
Seems like the PR is mainly missing tests, e.g., with OffsetArrays? (Of course, there are other possible improvements discussed in some comments above but in my opinion they could go into separate PRs since this PR is already a clear improvement for arrays with non-standard indices.)
@Moelf could we wrap up this PR? It looks almost ready to merge and I want to end all the negative press from StatsBase's frequent @inbounds errors.
(By the way, does eachindex still not automatically elide bounds checking?)
what's the desired action? do we want to use zip or @inbounds?
I'm happy with @inbounds, as long as eachindex is being used. If we want to fix that later that's fine, but for now we just need to fix the bugs.
oh, but then it's already fixed on master, closing now