Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of #80715 - JulianKnodt:skip_opt, r=nagisa
Change branching in `iter.skip()` Optimize branching in `Skip`, which was brought up in #80416. This assumes that if `next` is called, it's likely that there will be more calls to `next`, and the branch for skip will only be hit once thus it's unlikely to take that path. Even w/o the `unlikely` intrinsic, it compiles more efficiently, I believe because the path where `next` is called is always taken. It should be noted there are very few places in the compiler where `Skip` is used, so probably won't have a noticeable perf impact. [New impl](https://godbolt.org/z/85rdj4) [Old impl](https://godbolt.org/z/Wc74rh) [Some additional asm examples](https://godbolt.org/z/feKzoz) although they really don't have a ton of difference between them.
- Loading branch information