Files
rust/library/core/src
bors 4153fa82ff 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.
2021-01-23 09:25:11 +00:00
..
2020-10-31 16:26:06 +01:00
2021-01-13 15:05:39 -05:00
2020-07-27 19:51:13 -05:00
2021-01-18 11:24:48 +01:00
2021-01-13 14:51:27 +10:00
2020-12-09 23:13:24 +00:00
2020-11-22 13:45:14 +00:00
2021-01-16 10:40:36 +10:00
2020-09-01 19:56:32 +02:00
2021-01-17 16:11:48 +01:00
2020-07-27 19:51:13 -05:00
2021-01-03 19:54:54 +02:00
2020-07-27 19:51:13 -05:00
2020-09-08 22:26:44 -04:00
2021-01-18 11:24:48 +01:00
2020-11-19 19:23:36 -05:00
2020-07-27 19:51:13 -05:00
2020-10-27 15:48:58 -07:00
2020-07-27 19:51:13 -05:00
2020-07-27 19:51:13 -05:00