Skip to content

Commit

Permalink
Remove dependency on pdqselect
Browse files Browse the repository at this point in the history
  • Loading branch information
RReverser committed Jan 31, 2024
1 parent 587ab92 commit ef9057c
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 10 deletions.
7 changes: 0 additions & 7 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ edition = "2018"
[dependencies]
num-traits = "0.2.17"
ordered-float = "3.9.2"
pdqselect = "0.1.1"
typenum = "1.17.0"
paste = "1.0.14"
rayon = { version = "1.8.0", optional = true }
Expand Down
4 changes: 2 additions & 2 deletions src/sort.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ pub fn kd_sort_by<T>(
kd_compare: impl Fn(&T, &T, usize) -> Ordering + Copy,
) {
if items.len() >= 2 {
pdqselect::select_by(items, items.len() / 2, |x, y| kd_compare(x, y, axis));
items.select_nth_unstable_by(items.len() / 2, |x, y| kd_compare(x, y, axis));
let mid = items.len() / 2;
let axis = (axis + 1) % dim;
recurse(&mut items[..mid], axis, dim, kd_compare);
Expand All @@ -35,7 +35,7 @@ pub fn kd_par_sort_by<T: Send>(
kd_compare: impl Fn(&T, &T, usize) -> Ordering + Copy + Send,
) {
if items.len() >= 2 {
pdqselect::select_by(items, items.len() / 2, |x, y| kd_compare(x, y, axis));
items.select_nth_unstable_by(items.len() / 2, |x, y| kd_compare(x, y, axis));
let mid = items.len() / 2;
let axis = (axis + 1) % dim;
let (lhs, rhs) = items.split_at_mut(mid);
Expand Down

0 comments on commit ef9057c

Please sign in to comment.