Skip to content

Commit

Permalink
propagate inbonuds
Browse files Browse the repository at this point in the history
  • Loading branch information
Roger-luo committed Jul 7, 2020
1 parent d07dde9 commit 0ca04bc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/SparseMatrixCOO.jl
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,8 @@ end
findnz(coo::SparseMatrixCOO) = (coo.is, coo.js, coo.vs)
isdense(::SparseMatrixCOO) = false

function Base.setindex!(coo::SparseMatrixCOO{Tv,Ti}, v, i::Ti, j::Ti) where {Tv,Ti}
(1 <= i <= coo.m) && (1 <= j <= coo.n) || throw(BoundsError(coo, (i, j)))
Base.@propagate_inbounds function Base.setindex!(coo::SparseMatrixCOO{Tv,Ti}, v, i::Ti, j::Ti) where {Tv,Ti}
@boundscheck (1 <= i <= coo.m) && (1 <= j <= coo.n) || throw(BoundsError(coo, (i, j)))

push!(coo.is, i)
push!(coo.js, j)
Expand Down

0 comments on commit 0ca04bc

Please sign in to comment.