Skip to content

Commit

Permalink
sort: expanded comments
Browse files Browse the repository at this point in the history
[skip ci]
  • Loading branch information
jqnatividad committed Oct 25, 2023
1 parent b8feac9 commit 1b1a9bc
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/cmd/sort.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ sort options:
stable sort.
For --random sorts, this means using an alternative
random number generator (RNG) that uses the much faster
random number generator (RNG) that uses the faster
Wyrand algorithm instead of the ChaCha algorithm used
by the standard RNG.
Expand Down Expand Up @@ -145,7 +145,7 @@ pub fn run(argv: &[&str]) -> CliResult<()> {
fastrand::shuffle(&mut all); //DevSkim: ignore DS148264
},

// default stable sort
// default stable parallel sort
(false, false, false, false) => all.par_sort_by(|r1, r2| {
let a = sel.select(r1);
let b = sel.select(r2);
Expand All @@ -155,7 +155,7 @@ pub fn run(argv: &[&str]) -> CliResult<()> {
iter_cmp(a, b)
}
}),
// default --faster unstable sort
// default --faster unstable, non-allocating parallel sort
(false, false, false, true) => all.par_sort_unstable_by(|r1, r2| {
let a = sel.select(r1);
let b = sel.select(r2);
Expand All @@ -166,20 +166,20 @@ pub fn run(argv: &[&str]) -> CliResult<()> {
}
}),

// --numeric stable sort
// --numeric stable parallel numeric sort
(true, false, false, false) => all.par_sort_by(|r1, r2| {
let a = sel.select(r1);
let b = sel.select(r2);
iter_cmp_num(a, b)
}),
// --numeric --faster unstable sort
// --numeric --faster unstable, non-allocating, parallel numeric sort
(true, false, false, true) => all.par_sort_unstable_by(|r1, r2| {
let a = sel.select(r1);
let b = sel.select(r2);
iter_cmp_num(a, b)
}),

// --reverse stable sort
// --reverse stable parallel sort
(false, true, false, false) => all.par_sort_by(|r1, r2| {
let a = sel.select(r1);
let b = sel.select(r2);
Expand All @@ -189,7 +189,7 @@ pub fn run(argv: &[&str]) -> CliResult<()> {
iter_cmp(b, a)
}
}),
// --reverse --faster unstable sort
// --reverse --faster unstable parallel sort
(false, true, false, true) => all.par_sort_unstable_by(|r1, r2| {
let a = sel.select(r1);
let b = sel.select(r2);
Expand Down

0 comments on commit 1b1a9bc

Please sign in to comment.