about summary refs log tree commit diff
path: root/src/rustllvm/RustWrapper.cpp
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2019-07-08 12:03:06 +0000
committerbors <bors@rust-lang.org>2019-07-08 12:03:06 +0000
commit78ca1bda3522b14bc0336bc01dd1d49fdba2cda7 (patch)
tree5813defd55c883f4bd34ef618a3c93bc12042185 /src/rustllvm/RustWrapper.cpp
parent10840b8ae2182128f2e1c84b8aaf41452728de07 (diff)
parent98b54fbd7afd55f40531bdb350a5adb870958111 (diff)
downloadrust-78ca1bda3522b14bc0336bc01dd1d49fdba2cda7.tar.gz
rust-78ca1bda3522b14bc0336bc01dd1d49fdba2cda7.zip
Auto merge of #62473 - timvermeulen:is_sorted_by_key, r=scottmcm
Only call the closure parameter of Iterator::is_sorted_by_key once per item

See https://github.com/rust-lang/rust/issues/53485#issuecomment-472314004.

This changes `Iterator::is_sorted_by_key` to only call the given closure once for each item, which allows us to pass the items to the closure by value instead of by reference.

**Important**: `is_sorted_by_key` for slices and slice iterators is now no longer implemented in terms of the custom `slice::Iter::is_sorted_by` implementation. It's a trade-off: we could forward `slice::Iter::is_sorted_by_key` to it directly for potential SIMD benefits, but that would mean that the closure is potentially called twice for (almost) every element of the slice.
Diffstat (limited to 'src/rustllvm/RustWrapper.cpp')
0 files changed, 0 insertions, 0 deletions