about summary refs log tree commit diff
path: root/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2021-02-25 00:36:05 +0000
committerbors <bors@rust-lang.org>2021-02-25 00:36:05 +0000
commit63bacf14cd06f67171546670f22d8af509c29027 (patch)
treec2ad0b6a143522c477adfa081c37174116838675 /compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp
parent1fdadbf13aecd190b277ea2aa1b125d2ed986d55 (diff)
parentfc150d17b5e705132f0f70595dfc213aa6b564d3 (diff)
downloadrust-63bacf14cd06f67171546670f22d8af509c29027.tar.gz
rust-63bacf14cd06f67171546670f22d8af509c29027.zip
Auto merge of #82162 - cuviper:flat-fold, r=Mark-Simulacrum
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