Skip to content

Commit

Permalink
Ensure linearindices completely inlines (through _length)
Browse files Browse the repository at this point in the history
  • Loading branch information
mbauman committed Jan 23, 2017
1 parent 606c88f commit fbb047c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions base/abstractarray.jl
Original file line number Diff line number Diff line change
Expand Up @@ -120,10 +120,10 @@ julia> length(A)
60
```
"""
length(t::AbstractArray) = prod(size(t))
_length(A::AbstractArray) = prod(map(unsafe_length, indices(A))) # circumvent missing size
_length(A) = length(A)
endof(a::AbstractArray) = length(a)
length(t::AbstractArray) = (@_inline_meta; prod(size(t)))
_length(A::AbstractArray) = (@_inline_meta; prod(map(unsafe_length, indices(A)))) # circumvent missing size
_length(A) = (@_inline_meta; length(A))
endof(a::AbstractArray) = (@_inline_meta; length(a))
first(a::AbstractArray) = a[first(eachindex(a))]

"""
Expand Down

0 comments on commit fbb047c

Please sign in to comment.