Skip to content
This repository has been archived by the owner on Feb 18, 2024. It is now read-only.

Commit

Permalink
Fixed panic sort list array with different length (#1023)
Browse files Browse the repository at this point in the history
  • Loading branch information
b41sh committed May 29, 2022
1 parent 588e74f commit 48a3087
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/compute/sort/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -364,13 +364,13 @@ where
/// Compare two `Array`s based on the ordering defined in [ord](crate::array::ord).
fn cmp_array(a: &dyn Array, b: &dyn Array) -> Ordering {
let cmp_op = ord::build_compare(a, b).unwrap();
let length = a.len().max(b.len());
let length = a.len().min(b.len());

for i in 0..length {
let result = cmp_op(i, i);
if result != Ordering::Equal {
return result;
}
}
Ordering::Equal
a.len().cmp(&b.len())
}

0 comments on commit 48a3087

Please sign in to comment.