summaryrefslogtreecommitdiffstats
path: root/src/corelib/serialization
diff options
context:
space:
mode:
authorGiuseppe D'Angelo <giuseppe.dangelo@kdab.com>2020-10-11 17:45:48 +0200
committerGiuseppe D'Angelo <giuseppe.dangelo@kdab.com>2020-10-13 10:28:54 +0200
commitf8076d6a5be7d833bd81f4a7a66177ccd25b5fca (patch)
treeda390e3f8bfbf5c187e5721449d62eca6b29d1f2 /src/corelib/serialization
parent3e08154582edae4ae53ecd3f5b4eec2272eddf50 (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.h4
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)