diff --git a/stdlib/SparseArrays/src/higherorderfns.jl b/stdlib/SparseArrays/src/higherorderfns.jl index 029f4abd1fcf7..2f303a6659b68 100644 --- a/stdlib/SparseArrays/src/higherorderfns.jl +++ b/stdlib/SparseArrays/src/higherorderfns.jl @@ -2,11 +2,6 @@ module HigherOrderFns -_goodbuffers(n, colptr, rowval, nzval) = length(colptr) == n + 1 && colptr[end] - 1 == length(rowval) == length(nzval) -_goodbuffers(S::SparseMatrixCSC) = _goodbuffers(S.n, S.colptr, S.rowval, S.nzval) -_checkbuffers(S::SparseMatrixCSC) = (@assert _goodbuffers(S); S) -_checkbuffers(S::SparseVector) = (@assert length(S.nzval) == length(S.nzind); S) - # This module provides higher order functions specialized for sparse arrays, # particularly map[!]/broadcast[!] for SparseVectors and SparseMatrixCSCs at present. import Base: map, map!, broadcast, copy, copyto! @@ -152,6 +147,9 @@ function _reset!(C::SparseMatrixCSC) empty!(C.nzval) end +_checkbuffers(S::SparseMatrixCSC) = (@assert length(colptr) == n + 1 && colptr[end] - 1 == length(rowval) == length(nzval); S) +_checkbuffers(S::SparseVector) = (@assert length(S.nzval) == length(S.nzind); S) + _capacity(A::SparseVecOrMat) = capacity(storedinds(A)) # (2) map[!] entry points