Skip to content

Commit d4aa7cc

Browse files
committed
Removed Base.@_inline_meta and Vararg. Fixes #131
1 parent dd01250 commit d4aa7cc

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

src/array_interface.jl

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Base.axes(x::ComponentArray) = CombinedAxis.(getaxes(x), axes(getdata(x)))
1010

1111
Base.reinterpret(::Type{T}, x::ComponentArray, args...) where T = ComponentArray(reinterpret(T, getdata(x), args...), getaxes(x))
1212

13-
Base.reshape(A::AbstractArray, axs::Tuple{Vararg{<:CombinedAxis}}) = reshape(A, _array_axis.(axs))
13+
Base.reshape(A::AbstractArray, axs::NTuple{N,<:CombinedAxis}) where {N} = reshape(A, _array_axis.(axs))
1414

1515
# Cats
1616
# TODO: Make this a little less copy-pastey
@@ -61,7 +61,7 @@ Base.vcat(x::ComponentVector, args...) = vcat(getdata(x), getdata.(args)...)
6161
Base.vcat(x::ComponentVector, args::Union{Number, UniformScaling, AbstractVecOrMat}...) = vcat(getdata(x), getdata.(args)...)
6262
Base.vcat(x::ComponentVector, args::Vararg{AbstractVector{T}, N}) where {T,N} = vcat(getdata(x), getdata.(args)...)
6363

64-
function Base.hvcat(row_lengths::Tuple{Vararg{Int}}, xs::AbstractComponentVecOrMat...)
64+
function Base.hvcat(row_lengths::NTuple{N,Int}, xs::AbstractComponentVecOrMat...) where {N}
6565
i = 1
6666
idxs = UnitRange{Int}[]
6767
for row_length in row_lengths
@@ -84,8 +84,8 @@ Base.IndexStyle(::Type{<:ComponentArray{T,N,<:A,<:Axes}}) where {T,N,A,Axes} = I
8484
# Since we aren't really using the standard approach to indexing, this will forward things to
8585
# the correct methods
8686
Base.to_indices(x::ComponentArray, i::Tuple) = i
87-
Base.to_indices(x::ComponentArray, i::Tuple{Vararg{Union{Integer, CartesianIndex}, N}}) where N = i
88-
Base.to_indices(x::ComponentArray, i::Tuple{Vararg{Int64}}) where N = i
87+
Base.to_indices(x::ComponentArray, i::NTuple{N,Union{Integer, CartesianIndex}}) where N = i
88+
Base.to_indices(x::ComponentArray, i::NTuple{N,Int64}) where N = i
8989
Base.to_index(x::ComponentArray, i) = i
9090

9191
# Get ComponentArray index
@@ -120,13 +120,13 @@ Base.@propagate_inbounds Base.maybeview(x::ComponentArray, idx...) = _getindex(B
120120
inds = map(i -> i.idx, ci)
121121
axs = map(i -> i.ax, ci)
122122
axs = remove_nulls(axs...)
123-
return :(Base.@_inline_meta; ComponentArray(index_fun(getdata(x), $inds...), $axs...))
123+
return :(@inline; ComponentArray(index_fun(getdata(x), $inds...), $axs...))
124124
end
125125

126126
@generated function _setindex!(x::ComponentArray, v, idx...)
127127
ci = getindex.(getaxes(x), getval.(idx))
128128
inds = map(i -> i.idx, ci)
129-
return :(Base.@_inline_meta; setindex!(getdata(x), v, $inds...))
129+
return :(@inline; setindex!(getdata(x), v, $inds...))
130130
end
131131

132132
## Linear Algebra

src/broadcasting.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ Broadcast.axistype(a::AbstractUnitRange, b::CombinedAxis) = b
99
Broadcast.axistype(a::CombinedAxis, b::CombinedAxis) = CombinedAxis(FlatAxis(), Base.Broadcast.axistype(_array_axis(a), _array_axis(b)))
1010
Broadcast.axistype(a::T, b::T) where {T<:CombinedAxis} = a
1111

12-
Base.promote_shape(a::Tuple{Vararg{CombinedAxis}}, b::NTuple{N,AbstractUnitRange}) where {N} = Base.promote_shape(_array_axis.(a), b)
13-
Base.promote_shape(a::NTuple{N,AbstractUnitRange}, b::Tuple{Vararg{CombinedAxis}}) where {N} = Base.promote_shape(a, _array_axis.(b))
14-
Base.promote_shape(a::Tuple{Vararg{CombinedAxis}}, b::Tuple{Vararg{CombinedAxis}}) = Base.promote_shape(_array_axis.(a), _array_axis.(b))
15-
Base.promote_shape(a::T, b::T) where {T<:Tuple{Vararg{CombinedAxis}}} = a
12+
Base.promote_shape(a::NTuple{M,CombinedAxis}, b::NTuple{N,AbstractUnitRange}) where {M,N} = Base.promote_shape(_array_axis.(a), b)
13+
Base.promote_shape(a::NTuple{N,AbstractUnitRange}, b::NTuple{M,CombinedAxis}) where {M,N} = Base.promote_shape(a, _array_axis.(b))
14+
Base.promote_shape(a::NTuple{M,CombinedAxis}, b::NTuple{N,CombinedAxis}) where {M,N} = Base.promote_shape(_array_axis.(a), _array_axis.(b))
15+
Base.promote_shape(a::T, b::T) where {T<:NTuple{N,CombinedAxis} where N} = a
1616

1717
# From https://github.com/JuliaArrays/OffsetArrays.jl/blob/master/src/OffsetArrays.jl
1818
Base.dataids(A::ComponentArray) = Base.dataids(parent(A))

0 commit comments

Comments
 (0)