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

View File

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