Skip to content

Commit a838706

Browse files
committed
Remove Julia-version specific code
1 parent 46ecd73 commit a838706

File tree

2 files changed

+16
-35
lines changed

2 files changed

+16
-35
lines changed

src/array_of_similar_arrays.jl

Lines changed: 14 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -80,13 +80,11 @@ ArrayOfSimilarArrays(A::AbstractArray{<:AbstractArray{T,M},N}) where {T,M,N} =
8080
ArrayOfSimilarArrays{T,M,N}(A)
8181

8282

83-
@static if VERSION < v"0.7.0-DEV.3138"
84-
Base.convert(R::Type{ArrayOfSimilarArrays{T,M,N}}, parent::AbstractArray{U,L}) where {T,M,N,L,U} = R(parent)
83+
Base.convert(R::Type{ArrayOfSimilarArrays{T,M,N}}, parent::AbstractArray{U,L}) where {T,M,N,L,U} = R(parent)
8584

86-
Base.convert(R::Type{ArrayOfSimilarArrays{T,M,N}}, A::AbstractArray{<:AbstractArray{U,M},N}) where {T,M,N,U} = R(A)
87-
Base.convert(R::Type{ArrayOfSimilarArrays{T}}, A::AbstractArray{<:AbstractArray{U,M},N}) where {T,M,N,U} = R(A)
88-
Base.convert(R::Type{ArrayOfSimilarArrays}, A::AbstractArray{<:AbstractArray{T,M},N}) where {T,M,N} = R(A)
89-
end
85+
Base.convert(R::Type{ArrayOfSimilarArrays{T,M,N}}, A::AbstractArray{<:AbstractArray{U,M},N}) where {T,M,N,U} = R(A)
86+
Base.convert(R::Type{ArrayOfSimilarArrays{T}}, A::AbstractArray{<:AbstractArray{U,M},N}) where {T,M,N,U} = R(A)
87+
Base.convert(R::Type{ArrayOfSimilarArrays}, A::AbstractArray{<:AbstractArray{T,M},N}) where {T,M,N} = R(A)
9088

9189

9290
function _size_inner(A::AbstractArray{<:AbstractArray{T,M},N}) where {T,M,N}
@@ -132,11 +130,6 @@ Base.@propagate_inbounds Base.setindex!(A::ArrayOfSimilarArrays{T,M,N}, x::Abstr
132130
setindex!(A.data, x, _ncolons(Val{M}())..., idxs...)
133131

134132

135-
@static if VERSION < v"0.7.0-DEV.2791"
136-
Base.repremptyarray(io::IO, X::ArrayOfSimilarArrays{T,M,N,L,P}) where {T,M,N,L,P} = print(io, "ArrayOfSimilarArrays{$T,$M,$N,$L,$P}(", join(size(X),','), ')')
137-
end
138-
139-
140133
@inline function Base.resize!(A::ArrayOfSimilarArrays{T,M,N}, dims::Vararg{Integer,N}) where {T,M,N}
141134
resize!(A.data, _size_inner(A)..., dims...)
142135
A
@@ -213,11 +206,9 @@ VectorOfSimilarArrays(A::AbstractVector{<:AbstractArray{T,M}}) where {T,M} =
213206
VectorOfSimilarArrays{T,M}(A)
214207

215208

216-
@static if VERSION < v"0.7.0-DEV.3138"
217-
Base.convert(R::Type{VectorOfSimilarArrays{T}}, parent::AbstractArray{U,L}) where {T,U,L} = R(parent)
218-
Base.convert(R::Type{VectorOfSimilarArrays{T}}, A::AbstractVector{<:AbstractArray{U,M}}) where {T,M,U} = R(A)
219-
Base.convert(R::Type{VectorOfSimilarArrays}, A::AbstractVector{<:AbstractArray{T,M}}) where {T,M} = R(A)
220-
end
209+
Base.convert(R::Type{VectorOfSimilarArrays{T}}, parent::AbstractArray{U,L}) where {T,U,L} = R(parent)
210+
Base.convert(R::Type{VectorOfSimilarArrays{T}}, A::AbstractVector{<:AbstractArray{U,M}}) where {T,M,U} = R(A)
211+
Base.convert(R::Type{VectorOfSimilarArrays}, A::AbstractVector{<:AbstractArray{T,M}}) where {T,M} = R(A)
221212

222213

223214
@inline Base.IndexStyle(V::VectorOfSimilarArrays) = IndexLinear()
@@ -264,11 +255,9 @@ ArrayOfSimilarVectors(A::AbstractArray{<:AbstractVector{T},N}) where {T,N} =
264255
ArrayOfSimilarVectors{T,N}(A)
265256

266257

267-
@static if VERSION < v"0.7.0-DEV.3138"
268-
Base.convert(R::Type{ArrayOfSimilarVectors{T}}, parent::AbstractArray{U,L}) where {T,U,L} = R(parent)
269-
Base.convert(R::Type{ArrayOfSimilarVectors{T}}, A::AbstractArray{<:AbstractVector{U},N}) where {T,N,U} = R(A)
270-
Base.convert(R::Type{ArrayOfSimilarVectors}, A::AbstractArray{<:AbstractVector{T},N}) where {T,N} = R(A)
271-
end
258+
Base.convert(R::Type{ArrayOfSimilarVectors{T}}, parent::AbstractArray{U,L}) where {T,U,L} = R(parent)
259+
Base.convert(R::Type{ArrayOfSimilarVectors{T}}, A::AbstractArray{<:AbstractVector{U},N}) where {T,N,U} = R(A)
260+
Base.convert(R::Type{ArrayOfSimilarVectors}, A::AbstractArray{<:AbstractVector{T},N}) where {T,N} = R(A)
272261

273262

274263
const VectorOfSimilarVectors{
@@ -290,9 +279,7 @@ VectorOfSimilarVectors{T}(A::AbstractVector{<:AbstractVector{U}}) where {T,U} =
290279
VectorOfSimilarVectors(A::AbstractVector{<:AbstractVector{T}}) where {T} =
291280
VectorOfSimilarVectors{T}(A)
292281

293-
@static if VERSION < v"0.7.0-DEV.3138"
294-
Base.convert(R::Type{VectorOfSimilarVectors{T}}, parent::AbstractArray{U,2}) where {T,U} = R(parent)
295-
Base.convert(R::Type{VectorOfSimilarVectors}, parent::AbstractArray{T,2}) where {T} = R(parent)
296-
Base.convert(R::Type{VectorOfSimilarVectors{T}}, A::AbstractVector{<:AbstractVector{U}}) where {T,U} = R(A)
297-
Base.convert(R::Type{VectorOfSimilarVectors}, A::AbstractVector{<:AbstractVector{T}}) where {T} = R(A)
298-
end
282+
Base.convert(R::Type{VectorOfSimilarVectors{T}}, parent::AbstractArray{U,2}) where {T,U} = R(parent)
283+
Base.convert(R::Type{VectorOfSimilarVectors}, parent::AbstractArray{T,2}) where {T} = R(parent)
284+
Base.convert(R::Type{VectorOfSimilarVectors{T}}, A::AbstractVector{<:AbstractVector{U}}) where {T,U} = R(A)
285+
Base.convert(R::Type{VectorOfSimilarVectors}, A::AbstractVector{<:AbstractVector{T}}) where {T} = R(A)

src/vector_of_arrays.jl

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -86,10 +86,8 @@ end
8686
VectorOfArrays(A::AbstractVector{AbstractArray{T,N}}) where {T,N} = VectorOfArrays{T,N}(A)
8787

8888

89-
@static if VERSION < v"0.7.0-DEV.3138"
90-
Base.convert(VA::Type{VectorOfArrays{T,N}}, A::AbstractVector{AbstractArray{U,N}}) where {T,N,U} = VA(A)
91-
Base.convert(VA::Type{VectorOfArrays}, A::AbstractVector{AbstractArray{T,N}}) where {T,N} = VA(A)
92-
end
89+
Base.convert(VA::Type{VectorOfArrays{T,N}}, A::AbstractVector{AbstractArray{U,N}}) where {T,N,U} = VA(A)
90+
Base.convert(VA::Type{VectorOfArrays}, A::AbstractVector{AbstractArray{T,N}}) where {T,N} = VA(A)
9391

9492

9593
function full_consistency_checks(A::VectorOfArrays)
@@ -213,10 +211,6 @@ end
213211

214212
Base.length(A::VectorOfArrays) = length(A.kernel_size)
215213

216-
@static if VERSION < v"0.7.0-beta.250"
217-
Base._length(A::VectorOfArrays) = Base._length(A.kernel_size)
218-
end
219-
220214

221215
function Base.append!(A::VectorOfArrays{T,N}, B::VectorOfArrays{U,N}) where {T,N,U}
222216
if !isempty(B)

0 commit comments

Comments
 (0)