mirror of
https://github.com/Magnus167/rustframe.git
synced 2025-10-04 20:19:26 +00:00
Optimize column swapping logic to handle empty matrices and prevent unnecessary swaps
This commit is contained in:
@@ -148,12 +148,7 @@ impl<T: Clone> Matrix<T> {
|
||||
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;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user