-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Optimize slice {Chunks,Windows}::nth #138562
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
r? @Noratrieb rustbot has assigned @Noratrieb. Use |
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.
Thanks, one small comment and then we can merge it. I also renamed your PR to be more accurate
Generates branchless code
This avoids generating extra instructions that needlessly modify the slice's pointer
@bors r+ |
…llaumeGomez Rollup of 6 pull requests Successful merges: - rust-lang#138562 (Optimize slice {Chunks,Windows}::nth) - rust-lang#138876 (Trusty: Implement `write_vectored` for stdio ) - rust-lang#139072 (Add `slice::align_to_uninit_mut`) - rust-lang#139367 (Add `*_value` methods to proc_macro lib) - rust-lang#139391 (Check if merged attributes list is empty in expr) - rust-lang#139414 (Fix typo in `RawList`'s documentation) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of rust-lang#138562 - kornelski:nth-panic, r=Noratrieb Optimize slice {Chunks,Windows}::nth I've noticed that the `nth` functions on slice iters had non-optimized-out bounds checks. The new implementation even generates branchless code.
Optimize slice {Chunks,Windows}::nth I've noticed that the `nth` functions on slice iters had non-optimized-out bounds checks. The new implementation even generates branchless code.
I've noticed that the
nth
functions on slice iters had non-optimized-out bounds checks.The new implementation even generates branchless code.