From c8257763ea0acfd30860937ca594ec8dbb290b56 Mon Sep 17 00:00:00 2001 From: Matt Bauman Date: Mon, 25 Jan 2021 15:06:01 -0500 Subject: [PATCH] Fix #39367, doc for inbounds use each index (#39369) --- base/essentials.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/base/essentials.jl b/base/essentials.jl index bbba482b84974..ec113c39fa764 100644 --- a/base/essentials.jl +++ b/base/essentials.jl @@ -540,7 +540,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