rust/library/core
Matthias Krüger d6eb7bca09
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.
2022-10-19 07:15:30 +02:00
..
benches add a benchmark for slice_iter.copied().array_chunks() 2022-10-17 23:40:21 +02:00
primitive_docs
src Rollup merge of #103166 - the8472:copied-next-chunk, r=m-ou-se 2022-10-19 07:15:30 +02:00
tests Remove all uses of array_assume_init 2022-10-17 13:03:54 -07:00
Cargo.toml