diff options
| author | Pavel Krajcevski <Krajcevski@gmail.com> | 2018-10-28 09:16:46 -0700 |
|---|---|---|
| committer | Pavel Krajcevski <Krajcevski@gmail.com> | 2019-03-11 10:31:21 -0700 |
| commit | 3f306db3dbe390f43c7dfa8e17630747723e39e3 (patch) | |
| tree | 153f0ef69c239041acf7180349ce4b007a503689 /src/test/ui/thinlto | |
| parent | 88f755f8a84df1d9e6b17cf10c96ae8b93481b2e (diff) | |
| download | rust-3f306db3dbe390f43c7dfa8e17630747723e39e3.tar.gz rust-3f306db3dbe390f43c7dfa8e17630747723e39e3.zip | |
Add initial implementation of 'sort_at_index' for slices -- analog to C++'s std::nth_element (a.k.a. quickselect)
Add some more notes to the documentation: - Mention that the median can be found if we used `len() / 2`. - Mention that this function is usually called "kth element" in other libraries. Address some comments in PR: - Change wording on some of the documentation - Change recursive function into a loop Update name to `partition_at_index` and add convenience return values. Address reviewer comments: - Don't swap on each iteration when searching for min/max element. - Add some docs about when we panic. - Test that the sum of the lengths of the output matches the length of the input. - Style fix for for-loop. Address more reviewer comments Fix Rng stuff for test Fix doc test build Don't run the partition_at_index test on wasm targets Miri does not support entropy for test partition_at_index
Diffstat (limited to 'src/test/ui/thinlto')
0 files changed, 0 insertions, 0 deletions
