Skip to content

Commit c8683e5

Browse files
remove weird indices treatment
1 parent 3bba290 commit c8683e5

File tree

1 file changed

+1
-9
lines changed

1 file changed

+1
-9
lines changed

src/array_partition.jl

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ function ArrayPartition{T,T2<:Tuple}(x::T2,::Type{Val{T}}=Val{false})
1010
end
1111
end
1212
Base.similar(A::ArrayPartition) = ArrayPartition((similar.(A.x))...)
13-
Base.similar(A::ArrayPartition, dims::Tuple) = ArrayPartition(similar.(A.x, dims)...)
13+
Base.similar(A::ArrayPartition, dims::Tuple) = ArrayPartition((similar.(A.x))...) # Ignore dims / indices since it's a vector
1414
Base.similar{T}(A::ArrayPartition, ::Type{T}) = ArrayPartition(similar.(A.x, T)...)
1515
Base.similar{T}(A::ArrayPartition, ::Type{T}, dims::Tuple) = ArrayPartition(similar.(A.x, T, dims)...)
1616

@@ -81,14 +81,6 @@ Base.done(A::ArrayPartition,state) = done(chain(A.x...),state)
8181
Base.length(A::ArrayPartition) = sum((length(x) for x in A.x))
8282
Base.size(A::ArrayPartition) = (length(A),)
8383
Base.isempty(A::ArrayPartition) = (length(A) == 0)
84-
Base.indices(A::ArrayPartition) = ((indices(x) for x in A.x)...)
85-
function Base.indices(A::ArrayPartition,i::Int)
86-
if i == 1
87-
return Base.OneTo(length(A))
88-
else
89-
return Base.OneTo(1)
90-
end
91-
end
9284
Base.eachindex(A::ArrayPartition) = Base.OneTo(length(A))
9385

9486
# restore the type rendering in Juno

0 commit comments

Comments
 (0)