Skip to content

Commit

Permalink
use length for chunk iterator state rather than .taken (#81)
Browse files Browse the repository at this point in the history
  • Loading branch information
rafaqz authored Dec 15, 2022
1 parent 68c8150 commit 37dfacd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/iterator.jl
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,14 @@ macro implement_iteration(t)
function Base.iterate(a::$t, i)
datacur, bi, bstate = i
(chunkiter, innerinds) = bstate
cistateold = chunkiter.taken
cistateold = length(chunkiter)
biter = iterate(bi, bstate)
if biter === nothing
return nothing
end
innernow, bstatenew = biter
(chunkiter, innerinds) = bstatenew
if chunkiter.taken !== cistateold
if length(chunkiter) !== cistateold
curchunk = innerinds.itr.indices
datacur = OffsetArray(a[curchunk...], innerinds.itr)
end
Expand Down

0 comments on commit 37dfacd

Please sign in to comment.