Skip to content

Commit da53b70

Browse files
committed
Use mem::swap to swap variables
1 parent ef16de3 commit da53b70

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/float/add.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,7 @@ macro_rules! add {
7474

7575
// Swap a and b if necessary so that a has the larger absolute value.
7676
if b_abs > a_abs {
77-
let temp = a_rep;
78-
a_rep = b_rep;
79-
b_rep = temp;
77+
::core::mem::swap(&mut a_rep, &mut b_rep);
8078
}
8179

8280
// Extract the exponent and significand from the (possibly swapped) a and b.

0 commit comments

Comments
 (0)