Skip to content

Commit

Permalink
Inline indices
Browse files Browse the repository at this point in the history
Fixes performance regressions
  • Loading branch information
timholy committed Jun 29, 2016
1 parent 1b684d5 commit e1ef74a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion base/abstractarray.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit e1ef74a

Please sign in to comment.