Skip to content

incorrect iterate override #7

@nsajko

Description

@nsajko

It's not correct to "only iterate over stored values":

# Iteration - only iterates over stored values
function Base.iterate(A::NDSparseArray)
iter_state = iterate(A.data)
isnothing(iter_state) && return nothing
(idx, val), state = iter_state
return (val, state)
end
function Base.iterate(A::NDSparseArray, state)
iter_state = iterate(A.data, state)
isnothing(iter_state) && return nothing
(idx, val), new_state = iter_state
return (val, new_state)
end

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions