Skip to content

Commit

Permalink
Forward all calls to getindex(::Partials) to the inner container.
Browse files Browse the repository at this point in the history
Otherwise we always return an Array, where a Tuple would have sufficed
(eg. when indexing with ranges).
  • Loading branch information
maleadt authored and jrevels committed Aug 27, 2018
1 parent 19003af commit d8a30bf
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/partials.jl
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ end
@inline Base.length(::Partials{N}) where {N} = N
@inline Base.size(::Partials{N}) where {N} = (N,)

@inline Base.@propagate_inbounds Base.getindex(partials::Partials, i::Int) = partials.values[i]
@inline Base.@propagate_inbounds Base.getindex(partials::Partials, I...) = partials.values[I...]

Base.iterate(partials::Partials) = iterate(partials.values)
Base.iterate(partials::Partials, i) = iterate(partials.values, i)
Expand Down

0 comments on commit d8a30bf

Please sign in to comment.