diff options
author | lloyd <[email protected]> | 2009-11-19 18:12:32 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2009-11-19 18:12:32 +0000 |
commit | bab01ef1514266e6f23d9163e503c115147ab993 (patch) | |
tree | 6664f6cfde528ffab43d964b734b66374bd63593 | |
parent | 2ffa6f3f1616d7db3503600ac047a10b01a6bb54 (diff) |
Define move assignment and constructors in terms of std::swap (which
boils down to BigInt::swap, which uses the memvec swap). Checking with
g++ 4.5 -O3 shows it compiles down the same code as before.
-rw-r--r-- | src/math/bigint/bigint.cpp | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/src/math/bigint/bigint.cpp b/src/math/bigint/bigint.cpp index 36739f047..c777e770b 100644 --- a/src/math/bigint/bigint.cpp +++ b/src/math/bigint/bigint.cpp @@ -105,8 +105,7 @@ BigInt::BigInt(RandomNumberGenerator& rng, u32bit bits) */ BigInt::BigInt(BigInt&& other) { - reg.swap(other.reg); - signedness = other.signedness; + std::swap(*this, other); } /** @@ -115,10 +114,7 @@ BigInt::BigInt(BigInt&& other) BigInt& BigInt::operator=(BigInt&& other) { if(this != &other) - { - reg.swap(other.reg); - signedness = other.signedness; - } + std::swap(*this, other); return (*this); } |