Skip to content

Case 0 and 1 of k_smallest and variants #909

New issue

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

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

Already on GitHub? # to your account

Merged
merged 2 commits into from
Apr 4, 2024

Conversation

Philippe-Cholet
Copy link
Member

Fixes #904.
About the case k=0, I wonder if all our iterators behave well on iterators with side-effects. I think we should update the specialization tests.

The iterator can have side effects so I think it should be consumed in all cases, even k=0.
If there are no side-effect then maybe the compiler will optimize it away.
Like with `tail(1)`, I think we should leverage a possible faster specialization.
Copy link

codecov bot commented Mar 29, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 94.29%. Comparing base (6814180) to head (80c2b30).
Report is 42 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #909      +/-   ##
==========================================
- Coverage   94.38%   94.29%   -0.10%     
==========================================
  Files          48       48              
  Lines        6665     6815     +150     
==========================================
+ Hits         6291     6426     +135     
- Misses        374      389      +15     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@phimuemue phimuemue left a comment

Choose a reason for hiding this comment

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

Seems consistent with tail

@Philippe-Cholet Philippe-Cholet added this to the next milestone Apr 4, 2024
@Philippe-Cholet Philippe-Cholet added this pull request to the merge queue Apr 4, 2024
Merged via the queue into rust-itertools:master with commit 1ef5453 Apr 4, 2024
@Philippe-Cholet Philippe-Cholet deleted the issue-904 branch April 4, 2024 06:28
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

k_smallest[_by]/tail: similarities and differences
2 participants