diff options
author | Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> | 2020-10-11 17:45:48 +0200 |
---|---|---|
committer | Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> | 2020-10-13 10:28:54 +0200 |
commit | f8076d6a5be7d833bd81f4a7a66177ccd25b5fca (patch) | |
tree | da390e3f8bfbf5c187e5721449d62eca6b29d1f2 /src/corelib/serialization | |
parent | 3e08154582edae4ae53ecd3f5b4eec2272eddf50 (diff) |
QCborValue: streamline some code with qExchange
Change-Id: I79b68173a236ff1f28504a11ff182bdf48b2df0b
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/serialization')
-rw-r--r-- | src/corelib/serialization/qcborvalue.h | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/src/corelib/serialization/qcborvalue.h b/src/corelib/serialization/qcborvalue.h index 42dc307ef8..fd9f78a88d 100644 --- a/src/corelib/serialization/qcborvalue.h +++ b/src/corelib/serialization/qcborvalue.h @@ -179,10 +179,8 @@ public: QCborValue(const QCborValue &other); QCborValue(QCborValue &&other) noexcept - : n(other.n), container(other.container), t(other.t) + : n(other.n), container(qExchange(other.container, nullptr)), t(qExchange(other.t, Undefined)) { - other.t = Undefined; - other.container = nullptr; } QCborValue &operator=(const QCborValue &other); QT_MOVE_ASSIGNMENT_OPERATOR_IMPL_VIA_MOVE_AND_SWAP(QCborValue) |