From f8076d6a5be7d833bd81f4a7a66177ccd25b5fca Mon Sep 17 00:00:00 2001 From: Giuseppe D'Angelo Date: Sun, 11 Oct 2020 17:45:48 +0200 Subject: QCborValue: streamline some code with qExchange Change-Id: I79b68173a236ff1f28504a11ff182bdf48b2df0b Reviewed-by: Thiago Macieira --- src/corelib/serialization/qcborvalue.h | 4 +--- 1 file changed, 1 insertion(+), 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) -- cgit v1.2.3