Skip to content

Commit c57eb14

Browse files
simonstertkelman
authored andcommitted
Vectorize @ inbounds for x in A ...
This would previously have been an infinite loop if `length(A) == typemax(Int)` so the loop vectorizer couldn't compute a trip count. (cherry picked from commit fa89a6e) ref #13866
1 parent 04f3d15 commit c57eb14

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

base/array.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ collect(itr) = collect(eltype(itr), itr)
274274
## Iteration ##
275275
start(A::Array) = 1
276276
next(a::Array,i) = (a[i],i+1)
277-
done(a::Array,i) = (i > length(a))
277+
done(a::Array,i) = i == length(a)+1
278278

279279
## Indexing: getindex ##
280280

0 commit comments

Comments
 (0)