From e1ef74ade1f01ce54e7d0d028914da3edf919e91 Mon Sep 17 00:00:00 2001 From: Tim Holy Date: Wed, 29 Jun 2016 13:46:36 -0500 Subject: [PATCH] Inline indices Fixes performance regressions --- base/abstractarray.jl | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/base/abstractarray.jl b/base/abstractarray.jl index 9d248c1266a95..e048905a95d41 100644 --- a/base/abstractarray.jl +++ b/base/abstractarray.jl @@ -39,7 +39,10 @@ end Returns the tuple of valid indices for array `A`. """ -indices{T,N}(A::AbstractArray{T,N}) = _indices((), A) # faster than ntuple(d->indices(A,d), Val{N}) +function indices{T,N}(A::AbstractArray{T,N}) + @_inline_meta + _indices((), A) +end _indices{T,N}(out::NTuple{N}, A::AbstractArray{T,N}) = out function _indices(out, A::AbstractArray) @_inline_meta