Skip to content

Commit a45a3d7

Browse files
committed
rcb: use crate::partial_cmp for select_nth
Since this makes half as many float comparisons and select_nth_unstable ends up only matching for Ordering::Less anyway: https://github.com/rust-lang/rust/blob/cb0584f86b8cfa952dffad55f7d83bd90765120f/library/core/src/slice/mod.rs#L2719
1 parent 8e51c88 commit a45a3d7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/algorithms/recursive_bisection.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ fn rcb_recurse<const D: usize, W>(
135135

136136
let (left, _, _right_minus_one) = items
137137
.select_nth_unstable_by(split_idx, |item1, item2| {
138-
f64::partial_cmp(&item1.point[coord], &item2.point[coord]).unwrap()
138+
crate::partial_cmp(&item1.point[coord], &item2.point[coord])
139139
});
140140
let left_len = left.len();
141141
items.split_at_mut(left_len)

0 commit comments

Comments
 (0)