Skip to content

Commit

Permalink
fix invalid cmp
Browse files Browse the repository at this point in the history
Signed-off-by: Mingzhuo Yin <[email protected]>
  • Loading branch information
silver-ymz committed Feb 21, 2024
1 parent 1bd49d7 commit 16c8f2c
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion crates/base/src/vector/binary.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,15 @@ impl<'a> From<BinaryVecRef<'a>> for Vec<F32> {
impl<'a> Ord for BinaryVecRef<'a> {
fn cmp(&self, other: &Self) -> std::cmp::Ordering {
assert_eq!(self.dims, other.dims);
self.data.cmp(other.data).reverse()
for (&l, &r) in self.data.iter().zip(other.data.iter()) {
let l = l.reverse_bits();
let r = r.reverse_bits();
match l.cmp(&r) {
std::cmp::Ordering::Equal => {}
x => return x,
}
}
std::cmp::Ordering::Equal
}
}

Expand Down

0 comments on commit 16c8f2c

Please sign in to comment.