Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix indexing in _mapreducedim for OffsetArrays (#55506)
The destination array was being indexed incorrectly if it had offset indices. This led to the following on nightly: ```julia julia> using OffsetArrays julia> r = 5:100; julia> a = OffsetVector(r, 2); julia> sum(a, dims=1) 1-element OffsetArray(::Vector{Int64}, 3:3) with eltype Int64 with indices 3:3: 0 julia> sum(a) 5040 ``` The indexing was marked `@inbounds`, so this was not throwing an error. This PR also follows #55329 and only marks the indexing operations as `@inbounds`, omitting the function calls. --------- Co-authored-by: Matt Bauman <mbauman@juliahub.com> (cherry picked from commit 3d20a92)
- Loading branch information