From db3a59fe38f3a6fbd487f6ba01952327b74dd3fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mathieu=20Besan=C3=A7on?= Date: Fri, 21 Jul 2023 16:57:38 +0200 Subject: [PATCH] fix function --- src/sparsevector.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sparsevector.jl b/src/sparsevector.jl index b2de7ef2..bfb7b527 100644 --- a/src/sparsevector.jl +++ b/src/sparsevector.jl @@ -1565,7 +1565,7 @@ for fun in (:+, :-) res = spzeros(T, length(x)) copyto!(res, x) nzinds = nonzeroinds(y) - nzvals = nzvals(y) + nzvals = nonzeros(y) @inbounds for nzidx in eachindex(nzinds) res[nzinds[nzidx]] += nzvals[nzidx] end