Skip to content

Commit

Permalink
remove Base.setindex methods
Browse files Browse the repository at this point in the history
  • Loading branch information
hyrodium committed Jun 7, 2022
1 parent b1ce7bb commit 748fc97
Showing 1 changed file with 0 additions and 10 deletions.
10 changes: 0 additions & 10 deletions lib/ArrayInterfaceCore/src/ArrayInterfaceCore.jl
Original file line number Diff line number Diff line change
Expand Up @@ -121,16 +121,6 @@ function Base.setindex(x::AbstractArray, v, i...)
return _x
end

function Base.setindex(x::AbstractVector, v, i::Int)
n = length(x)
x .* (i .!== 1:n) .+ v .* (i .== 1:n)
end

function Base.setindex(x::AbstractMatrix, v, i::Int, j::Int)
n, m = Base.size(x)
x .* (i .!== 1:n) .* (j .!== i:m)' .+ v .* (i .== 1:n) .* (j .== i:m)'
end

"""
can_setindex(::Type{T}) -> Bool
Expand Down

0 comments on commit 748fc97

Please sign in to comment.