Skip to content

Commit

Permalink
Fixup #30507, check indexed assignment size for SparseMatrix (#30923)
Browse files Browse the repository at this point in the history
without assigning into the array twice.
  • Loading branch information
mbauman authored and StefanKarpinski committed Feb 4, 2019
1 parent 5695f83 commit a5f680f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion stdlib/SparseArrays/src/sparsematrix.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2504,7 +2504,7 @@ function setindex!(A::SparseMatrixCSC{Tv,Ti}, V::AbstractVecOrMat, Ix::Union{Int
require_one_based_indexing(A, V, Ix, Jx)
(I, J) = Base.ensure_indexable(to_indices(A, (Ix, Jx)))
checkbounds(A, I, J)
Base._setindex!(IndexStyle(A), A, V, to_indices(A, (Ix, Jx))...)
Base.setindex_shape_check(V, length(I), length(J))
B = _to_same_csc(A, V, I, J)

issortedI = issorted(I)
Expand Down

0 comments on commit a5f680f

Please sign in to comment.