about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2023-05-29 04:03:03 +0200
committerGitHub <noreply@github.com>2023-05-29 04:03:03 +0200
commite71b3b3cfac1ea515bc3cf2a6495f9261f265f43 (patch)
tree5136df958041afe21eb12bbc49913ca4c572aac7
parent760d46ed06f3c8cc471a2a9480291740930d1bd5 (diff)
parent448a38838771bfde7294a44e9f239c787fb516c5 (diff)
downloadrust-e71b3b3cfac1ea515bc3cf2a6495f9261f265f43.tar.gz
rust-e71b3b3cfac1ea515bc3cf2a6495f9261f265f43.zip
Rollup merge of #112045 - Sp00ph:update_current_impl, r=Amanieu
Followup to #111973

I somehow forgot to update the comment on `select_nth_unstable_by_key` in #111973, so this PR fixes that.

r? `@Amanieu`
-rw-r--r--library/core/src/slice/mod.rs5
1 files changed, 3 insertions, 2 deletions
diff --git a/library/core/src/slice/mod.rs b/library/core/src/slice/mod.rs
index 1f195555229..62003ddf515 100644
--- a/library/core/src/slice/mod.rs
+++ b/library/core/src/slice/mod.rs
@@ -3113,8 +3113,9 @@ impl<T> [T] {
     ///
     /// # Current implementation
     ///
-    /// The current algorithm is based on the quickselect portion of the same quicksort algorithm
-    /// used for [`sort_unstable`].
+    /// The current algorithm is an introselect implementation based on Pattern Defeating Quicksort, which is also
+    /// the basis for [`sort_unstable`]. The fallback algorithm is Median of Medians using Tukey's Ninther for
+    /// pivot selection, which guarantees linear runtime for all inputs.
     ///
     /// [`sort_unstable`]: slice::sort_unstable
     ///