diff --git a/src/matrix/mat.rs b/src/matrix/mat.rs index 14e5937..4ef1c4f 100644 --- a/src/matrix/mat.rs +++ b/src/matrix/mat.rs @@ -148,12 +148,7 @@ impl Matrix { c2, self.cols ); - if c1 == c2 { - return; - } - - if self.rows == 0 { - self.data.swap(c1, c2); + if c1 == c2 || self.rows == 0 || self.cols == 0 { return; }