mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-08-06 16:07:47 +00:00
Add back unstable sort
This commit is contained in:
parent
5fb7014c2b
commit
dbdac22262
1 changed files with 5 additions and 1 deletions
|
@ -1278,7 +1278,11 @@ fn ext_sort_by(unsorted: Vec<Line>, settings: GlobalSettings) -> Vec<Line> {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn sort_by(lines: &mut Vec<Line>, settings: &GlobalSettings) {
|
fn sort_by(lines: &mut Vec<Line>, settings: &GlobalSettings) {
|
||||||
lines.par_sort_by(|a, b| compare_by(a, b, &settings))
|
if settings.stable || settings.unique {
|
||||||
|
lines.par_sort_by(|a, b| compare_by(a, b, &settings))
|
||||||
|
} else {
|
||||||
|
lines.par_sort_unstable_by(|a, b| compare_by(a, b, &settings))
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn compare_by(a: &Line, b: &Line, global_settings: &GlobalSettings) -> Ordering {
|
fn compare_by(a: &Line, b: &Line, global_settings: &GlobalSettings) -> Ordering {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue