diff options
| author | Josh Stone <jistone@redhat.com> | 2021-02-15 11:52:28 -0800 |
|---|---|---|
| committer | Josh Stone <jistone@redhat.com> | 2021-02-15 11:52:28 -0800 |
| commit | fc150d17b5e705132f0f70595dfc213aa6b564d3 (patch) | |
| tree | 1e6f35bfc79387eb078f1df0d359fc1701d7e4cd /compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp | |
| parent | d1206f950ffb76c76e1b74a19ae33c2b7d949454 (diff) | |
| download | rust-fc150d17b5e705132f0f70595dfc213aa6b564d3.tar.gz rust-fc150d17b5e705132f0f70595dfc213aa6b564d3.zip | |
Expand FlattenCompat folds
The former `chain`+`chain`+`fold` implementation looked nice from a functional-programming perspective, but it introduced unnecessary layers of abstraction on every `flat_map`/`flatten` fold. It's straightforward to just fold each part in turn, and this makes it look like a simplified version of the existing `try_fold` implementation. For the `iter::bench_flat_map*` benchmarks, I get a large improvement in `bench_flat_map_chain_sum`, from 1,598,473 ns/iter to 499,889 ns/iter, and the rest are unchanged.
Diffstat (limited to 'compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp')
0 files changed, 0 insertions, 0 deletions
