diff --git a/base/essentials.jl b/base/essentials.jl index aba10a1a011c6..fc75213ee3678 100644 --- a/base/essentials.jl +++ b/base/essentials.jl @@ -538,7 +538,7 @@ element `i` of array `A` is skipped to improve performance. ```julia function sum(A::AbstractArray) r = zero(eltype(A)) - for i = 1:length(A) + for i in eachindex(A) @inbounds r += A[i] end return r