diff options
| author | Josh Stone <jistone@redhat.com> | 2017-06-21 13:22:27 -0700 |
|---|---|---|
| committer | Josh Stone <jistone@redhat.com> | 2017-06-21 13:22:27 -0700 |
| commit | 4a8ddac99e1edfb219e11c3ea2d6c43ccecb29ab (patch) | |
| tree | 0b8806c71633a73dc6b369b61001ec9942cebceb /src/liballoc | |
| parent | b4038977a39f7c5bfa76cccf586930ec57befbad (diff) | |
| download | rust-4a8ddac99e1edfb219e11c3ea2d6c43ccecb29ab.tar.gz rust-4a8ddac99e1edfb219e11c3ea2d6c43ccecb29ab.zip | |
Use `fold` to implement `Iterator::for_each`
The benefit of using internal iteration is shown in new benchmarks:
test iter::bench_for_each_chain_fold ... bench: 635,110 ns/iter (+/- 5,135)
test iter::bench_for_each_chain_loop ... bench: 2,249,983 ns/iter (+/- 42,001)
test iter::bench_for_each_chain_ref_fold ... bench: 2,248,061 ns/iter (+/- 51,940)
Diffstat (limited to 'src/liballoc')
0 files changed, 0 insertions, 0 deletions
