Skip to content

Commit

Permalink
Update test/utilities.jl
Browse files Browse the repository at this point in the history
Co-authored-by: Curtis Vogt <[email protected]>
  • Loading branch information
ericphanson and omus authored May 25, 2022
1 parent f59aa6c commit 15c6f60
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions test/utilities.jl
Original file line number Diff line number Diff line change
Expand Up @@ -80,14 +80,11 @@ end
end
end

# Are we iterating the right number of times?
# Count the elements in an iterator without using `length`
function count_len(itr)
c = 0
result = iterate(itr)
while result !== nothing
for _ in itr
c += 1
state = result[2]
result = iterate(itr, state)
end
return c
end
Expand Down

0 comments on commit 15c6f60

Please sign in to comment.