Use mem::swap to swap variables
This commit is contained in:
parent
ef16de3d37
commit
da53b70d34
|
@ -74,9 +74,7 @@ macro_rules! add {
|
||||||
|
|
||||||
// Swap a and b if necessary so that a has the larger absolute value.
|
// Swap a and b if necessary so that a has the larger absolute value.
|
||||||
if b_abs > a_abs {
|
if b_abs > a_abs {
|
||||||
let temp = a_rep;
|
::core::mem::swap(&mut a_rep, &mut b_rep);
|
||||||
a_rep = b_rep;
|
|
||||||
b_rep = temp;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Extract the exponent and significand from the (possibly swapped) a and b.
|
// Extract the exponent and significand from the (possibly swapped) a and b.
|
||||||
|
|
Loading…
Reference in New Issue