Skip to content

Commit f31ef76

Browse files
authored
Fix #39367, doc for inbounds use each index (#39369)
1 parent fd46fc6 commit f31ef76

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
@@ -540,7 +540,7 @@ element `i` of array `A` is skipped to improve performance.
540540
```julia
541541
function sum(A::AbstractArray)
542542
r = zero(eltype(A))
543-
for i = 1:length(A)
543+
for i in eachindex(A)
544544
@inbounds r += A[i]
545545
end
546546
return r

0 commit comments

Comments
 (0)