Skip to content

Commit

Permalink
Remove the unnessary method
Browse files Browse the repository at this point in the history
  • Loading branch information
junyuan-chen committed Apr 1, 2024
1 parent 027904e commit 61d2a27
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
6 changes: 0 additions & 6 deletions src/LabeledArrays.jl
Original file line number Diff line number Diff line change
Expand Up @@ -365,12 +365,6 @@ Base.@propagate_inbounds function Base.getindex(x::LabeledArrOrSubOrReshape{V,K,
return LabeledValue{V,K}(val, getvaluelabels(x))
end

Base.@propagate_inbounds function Base.getindex(x::LabeledArrOrSubOrReshape{V,N},
I::Vararg{Any,N}) where {V,N}
val = refarray(x)[I...]
return LabeledArray(val, getvaluelabels(x))
end

Base.fill!(x::LabeledArrOrSubOrReshape, v) = (fill!(refarray(x), unwrap(v)); x)

Base.resize!(x::LabeledVector, n::Integer) = (resize!(refarray(x), n); x)
Expand Down
3 changes: 3 additions & 0 deletions test/LabeledArrays.jl
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,9 @@ end
v = reshape(x, 3, 2)[1:2]
@test v isa LabeledArray
@test v.labels === lbls
v = reshape(x, 3, 2)[1:2, 1:2]
@test v isa LabeledArray
@test v.labels === lbls
v = view(x2, 1:3)[1:2]
@test v isa LabeledArray
@test v.labels === lbls
Expand Down

0 comments on commit 61d2a27

Please # to comment.