diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2022-10-19 07:15:30 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-10-19 07:15:30 +0200 |
| commit | d6eb7bca0918b7c5a9f252310ade34d393d4cc14 (patch) | |
| tree | cfa349e766ee0661b3bb003340f250cbff8aa9c7 /compiler/rustc_errors/src/snippet.rs | |
| parent | 2efc90e7381721df57348b61518b15794b75d189 (diff) | |
| parent | 873a18e2213a506d4cf6357e5faef0990ec08683 (diff) | |
| download | rust-d6eb7bca0918b7c5a9f252310ade34d393d4cc14.tar.gz rust-d6eb7bca0918b7c5a9f252310ade34d393d4cc14.zip | |
Rollup merge of #103166 - the8472:copied-next-chunk, r=m-ou-se
Optimize `slice_iter.copied().next_chunk()` ``` OLD: test iter::bench_copied_array_chunks ... bench: 371 ns/iter (+/- 7) NEW: test iter::bench_copied_array_chunks ... bench: 31 ns/iter (+/- 0) ``` The default `next_chunk` implementation suffers from having to assemble the array byte by byte via `next()`, checking the `Option<&T>` and then dereferencing `&T`. The specialization copies the chunk directly from the slice.
Diffstat (limited to 'compiler/rustc_errors/src/snippet.rs')
0 files changed, 0 insertions, 0 deletions
