Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit fbb047c

Browse files
committedJan 23, 2017
Ensure linearindices completely inlines (through _length)
1 parent 606c88f commit fbb047c

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed
 

‎base/abstractarray.jl

+4-4
Original file line numberDiff line numberDiff line change
@@ -120,10 +120,10 @@ julia> length(A)
120120
60
121121
```
122122
"""
123-
length(t::AbstractArray) = prod(size(t))
124-
_length(A::AbstractArray) = prod(map(unsafe_length, indices(A))) # circumvent missing size
125-
_length(A) = length(A)
126-
endof(a::AbstractArray) = length(a)
123+
length(t::AbstractArray) = (@_inline_meta; prod(size(t)))
124+
_length(A::AbstractArray) = (@_inline_meta; prod(map(unsafe_length, indices(A)))) # circumvent missing size
125+
_length(A) = (@_inline_meta; length(A))
126+
endof(a::AbstractArray) = (@_inline_meta; length(a))
127127
first(a::AbstractArray) = a[first(eachindex(a))]
128128

129129
"""

0 commit comments

Comments
 (0)
Please sign in to comment.