mirror of
https://github.com/Magnus167/rustframe.git
synced 2025-08-20 04:19:59 +00:00
Optimize column swapping logic to handle empty matrices and prevent unnecessary swaps
This commit is contained in:
parent
9fd3582061
commit
4c02006153
@ -148,12 +148,7 @@ impl<T: Clone> Matrix<T> {
|
|||||||
c2,
|
c2,
|
||||||
self.cols
|
self.cols
|
||||||
);
|
);
|
||||||
if c1 == c2 {
|
if c1 == c2 || self.rows == 0 || self.cols == 0 {
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if self.rows == 0 {
|
|
||||||
self.data.swap(c1, c2);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user