about summary refs log tree commit diff
path: root/compiler/rustc_errors/src/snippet.rs
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2022-10-19 07:15:30 +0200
committerGitHub <noreply@github.com>2022-10-19 07:15:30 +0200
commitd6eb7bca0918b7c5a9f252310ade34d393d4cc14 (patch)
treecfa349e766ee0661b3bb003340f250cbff8aa9c7 /compiler/rustc_errors/src/snippet.rs
parent2efc90e7381721df57348b61518b15794b75d189 (diff)
parent873a18e2213a506d4cf6357e5faef0990ec08683 (diff)
downloadrust-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