Skip to content

Commit

Permalink
Fix #39367, doc for inbounds use each index (#39369)
Browse files Browse the repository at this point in the history
(cherry picked from commit f31ef76)
  • Loading branch information
mbauman authored and KristofferC committed Dec 21, 2022
1 parent a5016e6 commit 5715f4e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion base/essentials.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 5715f4e

Please sign in to comment.