diff --git a/src/base/matrix.rs b/src/base/matrix.rs index db745887..05ff2a53 100644 --- a/src/base/matrix.rs +++ b/src/base/matrix.rs @@ -894,10 +894,14 @@ where { #[inline] fn partial_cmp(&self, other: &Self) -> Option { - if self.shape() != other.shape() || self.nrows() == 0 || self.ncols() == 0 { + if self.shape() != other.shape() { return None; } + if self.nrows() == 0 || self.ncols() == 0 { + return Some(Ordering::Equal); + } + let mut first_ord = unsafe { self.data .get_unchecked_linear(0)