Skip to content

Commit b9f008b

Browse files
authored
Update wording
1 parent 3eb87db commit b9f008b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

library/alloc/src/slice.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -371,11 +371,11 @@ impl<T> [T] {
371371

372372
/// Sorts the slice with a key extraction function.
373373
///
374-
/// During sorting, the key function is called only once per element.
374+
/// During sorting, the key function is called at most once per element, by using
375+
/// temporary storage to remember the results of key evaluation.
375376
///
376377
/// This sort is stable (i.e., does not reorder equal elements) and *O*(*m* \* *n* + *n* \* log(*n*))
377-
/// worst-case, where the key function is *O*(*m*). If the slice requires sorting,
378-
/// the key function is called on all elements of the slice in the original order.
378+
/// worst-case, where the key function is *O*(*m*).
379379
///
380380
/// For simple key functions (e.g., functions that are property accesses or
381381
/// basic operations), [`sort_by_key`](slice::sort_by_key) is likely to be

0 commit comments

Comments
 (0)