Skip to content

Conversation

@mzgubic
Copy link
Member

@mzgubic mzgubic commented Jun 16, 2021

Fixes #369

next isa Nothing && return nothing
element, new_state = next
return element, (val, new_state)
end
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we may want to rename val to obj or underlying_object or something.
so it is clear that it is the object actually being iterated rather than being a value from the object being iterated

Copy link
Member

@simeonschaub simeonschaub left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@inline function Base.iterate(::AbstractThunk, (val, state))
element, new_state = iterate(val, state)
next = iterate(val, state)
next isa Nothing && return nothing
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't really matter, but this is generally more idiomatic:

Suggested change
next isa Nothing && return nothing
next === nothing && return nothing

@codecov-commenter
Copy link

codecov-commenter commented Jun 16, 2021

Codecov Report

Merging #370 (41d3a6d) into master (7947bed) will increase coverage by 1.44%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #370      +/-   ##
==========================================
+ Coverage   87.42%   88.86%   +1.44%     
==========================================
  Files          14       14              
  Lines         485      485              
==========================================
+ Hits          424      431       +7     
+ Misses         61       54       -7     
Impacted Files Coverage Δ
src/differentials/thunks.jl 92.59% <100.00%> (+25.92%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7947bed...41d3a6d. Read the comment docs.

@mzgubic mzgubic merged commit bf01ddf into master Jun 16, 2021
@mzgubic mzgubic deleted the mz/iterate-thunks branch June 16, 2021 11:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Iteration of thunks is broken

5 participants