Skip to content

Commit 4546145

Browse files
vtjnashrafaqz
authored andcommitted
Avoid unnecessary allocation of a new Stateful on each chunk
1 parent 689d7fe commit 4546145

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/iterator.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ function Base.iterate(::BlockedIndices, i)
2626
if r === nothing
2727
ii = iterate(chunkiter)
2828
ii === nothing && return nothing
29-
innerinds = Iterators.Stateful(CartesianIndices(first(ii)))
29+
Iterators.reset!(innerinds, CartesianIndices(first(ii)))
3030
r = iterate(innerinds)
3131
r === nothing && return nothing
3232
return first(r), (chunkiter, innerinds)

0 commit comments

Comments
 (0)