Skip to content

Commit

Permalink
No extra space is used in unstable sorts
Browse files Browse the repository at this point in the history
  • Loading branch information
cuviper committed Jan 6, 2022
1 parent 7bdcfc0 commit 6fca269
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -725,7 +725,7 @@ where
/// The comparison function receives two key and value pairs to compare (you
/// can sort by keys or values or their combination as needed).
///
/// Computes in **O(n log n + c)** time and **O(n)** space where *n* is
/// Computes in **O(n log n + c)** time where *n* is
/// the length of the map and *c* is the capacity. The sort is unstable.
pub fn sort_unstable_by<F>(&mut self, mut cmp: F)
where
Expand Down
2 changes: 1 addition & 1 deletion src/set.rs
Original file line number Diff line number Diff line change
Expand Up @@ -596,7 +596,7 @@ where

/// Sort the set's values in place using the comparison funtion `cmp`.
///
/// Computes in **O(n log n)** time and **O(n)** space. The sort is unstable.
/// Computes in **O(n log n)** time. The sort is unstable.
pub fn sort_unstable_by<F>(&mut self, mut cmp: F)
where
F: FnMut(&T, &T) -> Ordering,
Expand Down

0 comments on commit 6fca269

Please sign in to comment.