Skip to content

Commit f6148a0

Browse files
committed
Avoid infinite loop
1 parent 1aa1964 commit f6148a0

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/abstractsparsearrayinterface.jl

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,10 @@ using DerivableInterfaces: DerivableInterfaces, zero!
104104
# More generally, this codepath could be taking if `zero(eltype(a))`
105105
# is defined and the elements are immutable.
106106
f = eltype(a) <: Number ? Returns(zero(eltype(a))) : zero!
107-
return @interface interface map_stored!(f, a, a)
107+
@inbounds for I in eachstoredindex(a)
108+
a[I] = f(a[I])
109+
end
110+
return a
108111
end
109112

110113
# `f::typeof(norm)`, `op::typeof(max)` used by `norm`.

0 commit comments

Comments
 (0)