Skip to content

Commit 4847db3

Browse files
committed
Avoid dynamic dispatch in similar
1 parent 16653b0 commit 4847db3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/OffsetArrays.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,10 @@ Base.eachindex(::LinearFast, A::OffsetVector) = indices(A, 1)
5959
_indices(::Tuple{}, ::Tuple{}) = ()
6060
Base.indices1{T}(A::OffsetArray{T,0}) = 1:1 # we only need to specialize this one
6161

62-
function Base.similar(A::OffsetArray, T::Type, dims::Dims)
62+
function Base.similar{T}(A::OffsetArray, ::Type{T}, dims::Dims)
6363
B = similar(parent(A), T, dims)
6464
end
65-
function Base.similar(A::AbstractArray, T::Type, inds::Tuple{UnitRange,Vararg{UnitRange}})
65+
function Base.similar{T}(A::AbstractArray, ::Type{T}, inds::Tuple{UnitRange,Vararg{UnitRange}})
6666
B = similar(A, T, map(length, inds))
6767
OffsetArray(B, map(indexoffset, inds))
6868
end

0 commit comments

Comments
 (0)