Uh oh!
There was an error while loading. Please reload this page.
specialize Iterator::nth for Cycles over ExactSizeIterators to - #47555
specialize Iterator::nth for Cycles over ExactSizeIterators to#47555llogiq wants to merge 5 commits into
Conversation
reduce clones at the cost of one remainder. This should be faster in most cases and may in some situations reduce memory churn via clones.
rust-highfive
commented
Jan 18, 2018
(rust_highfive has picked a reviewer for you, use r? to override) |
varkor
commented
Jan 18, 2018
This is subject to the same discussion as in #47533, concerning observability of |
withoutboats
commented
Jan 18, 2018
| #[stable(feature = "rust1", since = "1.0.0")] | ||
| impl<I> Iterator for Cycle<I> | ||
| where I: Clone + Iterator + ExactSizeIterator, | ||
| <I as Iterator>::Item : Clone + Copy { |
There was a problem hiding this comment.
This should be just I::Item: Copy style wise. Iterator + ExactSizeIterator is also redundant, just ExactSizeIterator is the same.
bluss
commented
Jan 20, 2018
Omitting Clone calls for Current implementation omits the clones of the iterator itself, so a motivation is needed for that too. |
llogiq
commented
Jan 21, 2018
Thank you for the review! We require Regarding the iterator, I can change it to require |
durka
commented
Jan 21, 2018
Iterators aren't |
llogiq
commented
Jan 21, 2018
Too true, I better revert that one. So since we cannot require |
shepmaster
commented
Jan 26, 2018
Ping from triage, @bluss — new commits up for you to review! |
bluss
commented
Jan 26, 2018
I think the same applies as in the other PRs, see this comment #47533 (comment) |
kennytm
commented
Jan 31, 2018
Ping from triage @bluss@llogiq! Given the linked comment #47533 (comment), I guess this PR should be closed since clones of the iterator itself are still elided, and an RFC detailing whether clone elision is acceptable should be accepted before this PR can be reconsidered? |
llogiq
commented
Jan 31, 2018
Until we all reach decision |
reduce clones at the cost of one remainder. This should be faster in most cases and may in some situations reduce memory churn via clones.