Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes DistinctIterator to not eat null values #2426

Merged
merged 2 commits into from
Jul 4, 2019

Conversation

danieldietrich
Copy link
Contributor

Fixes #2425

next = null;
return result;
nextDefined = false;
return next;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

We still hold the reference on the last consumed next value.
Corner case: a reference to this iterator remains. Then the last iterator value that was consumed can't be garbage collected.

I think I will set next = null in another commit to be clean here.

@codecov-io
Copy link

Codecov Report

Merging #2426 into master will increase coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@             Coverage Diff             @@
##             master   #2426      +/-   ##
===========================================
+ Coverage     95.89%   95.9%   +<.01%     
  Complexity     5479    5479              
===========================================
  Files            94      94              
  Lines         13340   13344       +4     
  Branches       1612    1612              
===========================================
+ Hits          12793   12797       +4     
  Misses          408     408              
  Partials        139     139
Impacted Files Coverage Δ Complexity Δ
...avr/src/main/java/io/vavr/collection/Iterator.java 99.23% <100%> (ø) 182 <0> (ø) ⬇️

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 cf1243c...6eb08a8. Read the comment docs.

1 similar comment
@codecov-io
Copy link

Codecov Report

Merging #2426 into master will increase coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@             Coverage Diff             @@
##             master   #2426      +/-   ##
===========================================
+ Coverage     95.89%   95.9%   +<.01%     
  Complexity     5479    5479              
===========================================
  Files            94      94              
  Lines         13340   13344       +4     
  Branches       1612    1612              
===========================================
+ Hits          12793   12797       +4     
  Misses          408     408              
  Partials        139     139
Impacted Files Coverage Δ Complexity Δ
...avr/src/main/java/io/vavr/collection/Iterator.java 99.23% <100%> (ø) 182 <0> (ø) ⬇️

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 cf1243c...6eb08a8. Read the comment docs.

@danieldietrich danieldietrich merged commit 2f2ffb8 into master Jul 4, 2019
@danieldietrich danieldietrich deleted the distinct-iterator branch July 4, 2019 21:44
@danieldietrich danieldietrich modified the milestones: v1.0.0, v0.10.1 Jul 8, 2019
@danieldietrich danieldietrich changed the title Fixes DistictIterator to not eat null values Fixes DistinctIterator to not eat null values Jul 22, 2019
danieldietrich added a commit that referenced this pull request Jul 22, 2019
* Fixes #2425

* Releasing last consumed 'next' element.
thadumi pushed a commit to thadumi/vavr that referenced this pull request Dec 11, 2019
* Fixes vavr-io#2425

* Releasing last consumed 'next' element.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

DistinctIterator eats null values
2 participants