Uh oh!
There was an error while loading. Please reload this page.
Implement nth for EscapeUnicode - #33932
Conversation
Extract a function that updates the iterator state and returns the result of an arbitrary step of iteration. This implements the same logic as `next`, but it can be shared with `nth`.
as a step from the appropriate state. Part of rust-lang#24214.
This makes it easier to have a unique path for handling all of them.
by extracting a shared `step` function.
rust-highfive
commented
May 28, 2016
r? @brson (rust_highfive has picked a reviewer for you, use r? to override) |
ranma42
commented
May 28, 2016
Given that he has already reviewed the previous PRs, r? @alexcrichton |
alexcrichton
commented
May 31, 2016
This... seems like a lot of code for a pretty minor feature. Out of curiosity is there a crate which is actually exercising this in terms of desiring performance gains or are these just being done for completeness? If they're only done for completeness I'd somewhat prefer to hold off on the extra complexity for now. |
brson
commented
May 31, 2016
Is it definitely a perf win? I spent a while looking at this patch before deciding I didn't understand it enough to review. So I sort of agree with alex that it may not be worth the churn. |
ranma42
commented
Jun 1, 2016
A little less churn would be possible by implementing The changes to The implementation of I agree that there is little use for this micro-optimisation (especially considered that the offsetting logic is not completely obvious at first sight), so it can probably be held off with no disadvantage. |
alexcrichton
commented
Jun 5, 2016
Ok, in that case it seems fine to close this for now and we can revisit if it becomes a perf hazard for someone? |
and cleanup the code for
nthforEscapeDefaultby sharing the stepping logic betweennthandnext.Part of #24214, split from #31049 (last part! :) ).
The test for
nthwas added in #33103.