more std::mem::swap changes

This commit is contained in:
Henry Schimke
2022-12-29 17:46:09 -06:00
parent 09f25bfacc
commit 1c94af40ee
2 changed files with 4 additions and 12 deletions

View File

@@ -367,12 +367,8 @@ impl Detector {
let steep = (toY - fromY).abs() > (toX - fromX).abs();
if steep {
let mut temp = fromX;
fromX = fromY;
fromY = temp;
temp = toX;
toX = toY;
toY = temp;
std::mem::swap(&mut fromX, &mut fromY);
std::mem::swap(&mut toX, &mut toY);
}
let dx = (toX - fromX).abs();