Make shape check a one-liner in impl PartialEq for Matrix

This commit is contained in:
S.Brandeis 2020-01-25 12:58:05 +01:00 committed by Sébastien Crozet
parent d35ef06f44
commit 08d990f276
1 changed files with 1 additions and 4 deletions

View File

@ -1356,10 +1356,7 @@ where
{ {
#[inline] #[inline]
fn eq(&self, right: &Matrix<N, R2, C2, S2>) -> bool { fn eq(&self, right: &Matrix<N, R2, C2, S2>) -> bool {
if self.shape() == right.shape() { self.shape() == right.shape() && self.iter().zip(right.iter()).all(|(l, r)| l == r)
return self.iter().zip(right.iter()).all(|(l, r)| l == r)
}
false
} }
} }