mirror of
https://github.com/starovoid/rxing.git
synced 2026-07-27 21:02:35 +00:00
convert most variable swaps to mem swaps
This commit is contained in:
@@ -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()];
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user