-
Notifications
You must be signed in to change notification settings - Fork 13.3k
implement advance_(back_)_by on more iterators #87091
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
Conversation
(rust-highfive has picked a reviewer for you, use r? to override) |
@timvermeulen I changed the API contract of a bit. Do they look ok to you? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've left a couple of comments, let me know what you think about them
Thanks for the reviews @pickfire @SkiFire13 I have closed the conversation for the issues that I think should be addressed now. I have completely rewritten The fixes are in separate commits for easier review. |
I ran some of the core benchmarks, decent improvements for the
The zip case is interesting (0..100000).skip(100).cycle().skip(100)
.zip((0..100000).cycle().skip(10))
.map(|(a,b)| a+b)
.skip(100000)
.take(1000000)
.sum() The outer |
☔ The latest upstream changes (presumably #87768) made this pull request unmergeable. Please resolve the merge conflicts. |
910e4db
to
046e12e
Compare
This comment has been minimized.
This comment has been minimized.
046e12e
to
c41df9b
Compare
This comment has been minimized.
This comment has been minimized.
c41df9b
to
3972694
Compare
☔ The latest upstream changes (presumably #87375) made this pull request unmergeable. Please resolve the merge conflicts. |
3972694
to
36d0b6d
Compare
☔ The latest upstream changes (presumably #89158) made this pull request unmergeable. Please resolve the merge conflicts. |
36d0b6d
to
02955d2
Compare
This comment has been minimized.
This comment has been minimized.
02955d2
to
f4d288a
Compare
☔ The latest upstream changes (presumably #89386) made this pull request unmergeable. Please resolve the merge conflicts. |
f4d288a
to
ffd7ade
Compare
This looks reasonable to me. @bors r+ |
📌 Commit ffd7ade has been approved by |
Add more efficient, non-default implementations for
feature(iter_advance_by)
(#77404) on more iterators and adapters.This PR only contains implementations where skipping over items doesn't elide any observable side-effects such as user-provided closures or
clone()
functions. I'll put those in a separate PR.