convert most variable swaps to mem swaps

This commit is contained in:
Henry Schimke
2022-12-19 18:04:43 -06:00
parent eaacf31923
commit 8a0cc78c61
11 changed files with 16 additions and 39 deletions

View File

@@ -214,9 +214,8 @@ impl GlobalHistogramBinarizer {
// Make sure firstPeak corresponds to the black peak.
if firstPeak > secondPeak {
let temp = firstPeak;
firstPeak = secondPeak;
secondPeak = temp;
std::mem::swap(&mut firstPeak, &mut secondPeak);
}
// If there is too little contrast in the image to pick a meaningful black point, throw rather

View File

@@ -154,9 +154,7 @@ impl GenericGFPoly {
let mut smallerCoefficients = self.coefficients.clone();
let mut largerCoefficients = other.coefficients.clone();
if smallerCoefficients.len() > largerCoefficients.len() {
let temp = smallerCoefficients;
smallerCoefficients = largerCoefficients;
largerCoefficients = temp;
std::mem::swap(&mut smallerCoefficients,&mut largerCoefficients)
}
let mut sumDiff = vec![0; largerCoefficients.len()];

View File

@@ -121,9 +121,7 @@ impl ReedSolomonDecoder {
let mut a = a.clone();
let mut b = b.clone();
if a.getDegree() < b.getDegree() {
let temp = a;
a = b;
b = temp;
std::mem::swap(&mut a, &mut b);
}
let mut rLast = a;