diff options
author | Marc Mutz <marc.mutz@qt.io> | 2022-05-11 17:23:29 +0200 |
---|---|---|
committer | Marc Mutz <marc.mutz@qt.io> | 2022-05-11 18:25:04 +0200 |
commit | 0fcd1a12db38b463aa4990488cbf19d96f573ca3 (patch) | |
tree | 45843378de53cb0fa5f46abef6f5a8665efdf117 /src | |
parent | b032af7e8b8eb8b4156b56ae22dc9f6e5900a404 (diff) |
QtCoap: replace qSwap with member-swap where possible
qSwap() is a monster that looks for ADL overloads of swap() and also
detects the noexcept of the wrapped swap() function, so it should only
be used when the argument type is unknown. In the vast majority of
cases, the type is known to be efficiently std::swap()able or to have
a member-swap. Call either of these.
Task-number: QTBUG-97601
Pick-to: 6.3 6.2 5.15
Change-Id: Icaed67ff42bc148cb70e42d3377dea6b7eed908e
Reviewed-by: MÃ¥rten Nordheim <marten.nordheim@qt.io>
Diffstat (limited to 'src')
-rw-r--r-- | src/coap/qcoapsecurityconfiguration.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/coap/qcoapsecurityconfiguration.h b/src/coap/qcoapsecurityconfiguration.h index 7dd2d9c..73b1bd9 100644 --- a/src/coap/qcoapsecurityconfiguration.h +++ b/src/coap/qcoapsecurityconfiguration.h @@ -57,7 +57,7 @@ public: QCoapPrivateKey &operator=(const QCoapPrivateKey &other); void swap(QCoapPrivateKey &other) noexcept - { qSwap(d, other.d); } + { d.swap(other.d); } bool isNull() const; @@ -84,7 +84,7 @@ public: QCoapSecurityConfiguration &operator=(const QCoapSecurityConfiguration &other); void swap(QCoapSecurityConfiguration &other) noexcept - { qSwap(d, other.d); } + { d.swap(other.d); } void setPreSharedKeyIdentity(const QByteArray &preSharedKeyIdentity); QByteArray preSharedKeyIdentity() const; |