From fa89a6e656272de0ec1360f5fec974dd4b9d4781 Mon Sep 17 00:00:00 2001 From: Simon Kornblith Date: Tue, 3 Nov 2015 18:29:40 -0500 Subject: [PATCH] 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. --- base/array.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/base/array.jl b/base/array.jl index e0f378fd707b4..b9ab49dd1e42d 100644 --- a/base/array.jl +++ b/base/array.jl @@ -265,7 +265,7 @@ collect(itr) = collect(eltype(itr), itr) ## Iteration ## start(A::Array) = 1 next(a::Array,i) = (a[i],i+1) -done(a::Array,i) = (i > length(a)) +done(a::Array,i) = i == length(a)+1 ## Indexing: getindex ##