Skip to content

Commit 3e99288

Browse files
authored
Update subarray.jl
1 parent 2193638 commit 3e99288

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

base/subarray.jl

+4-4
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ viewindexing() = LinearFast()
4040
viewindexing(I::Tuple{ScalarIndex, Vararg{Any}}) = (@_inline_meta; viewindexing(tail(I)))
4141
# Colons may begin a section which may be followed by any number of Colons
4242
viewindexing(I::Tuple{Colon, Colon, Vararg{Any}}) = (@_inline_meta; viewindexing(tail(I)))
43-
# A UnitRange can follow Colons, but only if all other indices are scalar
44-
viewindexing(I::Tuple{Colon, UnitRange, Vararg{ScalarIndex}}) = LinearFast()
43+
# An AbstractUnitRange can follow Colons, but only if all other indices are scalar
44+
viewindexing(I::Tuple{Colon, AbstractUnitRange, Vararg{ScalarIndex}}) = LinearFast()
4545
# In general, ranges are only fast if all other indices are scalar
4646
viewindexing(I::Tuple{Union{Range, Colon}, Vararg{ScalarIndex}}) = LinearFast()
4747
# All other index combinations are slow
@@ -156,8 +156,8 @@ function getindex(V::FastSubArray, i::Real)
156156
@inbounds r = V.parent[V.offset1 + V.stride1*to_index(i)]
157157
r
158158
end
159-
# We can avoid a multiplication if the first parent index is a Colon or UnitRange
160-
typealias FastContiguousSubArray{T,N,P,I<:Tuple{Union{Colon, UnitRange}, Vararg{Any}}} SubArray{T,N,P,I,true}
159+
# We can avoid a multiplication if the first parent index is a Colon or AbstractUnitRange
160+
typealias FastContiguousSubArray{T,N,P,I<:Tuple{Union{Colon, AbstractUnitRange}, Vararg{Any}}} SubArray{T,N,P,I,true}
161161
function getindex(V::FastContiguousSubArray, i::Real)
162162
@_inline_meta
163163
@boundscheck checkbounds(V, i)

0 commit comments

Comments
 (0)