Skip to content

Commit 94a3ca8

Browse files
mbaumanstaticfloat
authored andcommitted
Fix #39367, doc for inbounds use each index (#39369)
(cherry picked from commit f31ef76)
1 parent 7848949 commit 94a3ca8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

base/essentials.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -538,7 +538,7 @@ element `i` of array `A` is skipped to improve performance.
538538
```julia
539539
function sum(A::AbstractArray)
540540
r = zero(eltype(A))
541-
for i = 1:length(A)
541+
for i in eachindex(A)
542542
@inbounds r += A[i]
543543
end
544544
return r

0 commit comments

Comments
 (0)