summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@qt.io>2022-05-11 17:18:34 +0200
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2022-05-11 17:57:49 +0000
commit227b3fec905d65961e2ffbb9f149d8cd8c5bc396 (patch)
tree1f012591962cd2673e0369e7e293a69dcf01310d
parenteed40f48b2ef46e669a273dac83ae7845cc7966d (diff)
QtSerialBus: replace qSwap with std::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 Change-Id: I89336e147d12e6d6563fab2e76f5ae7eec4ff220 Reviewed-by: MÃ¥rten Nordheim <marten.nordheim@qt.io> (cherry picked from commit fe7cd7255f82b3884651045422192bd7960cb0be) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r--src/serialbus/qcanbusdeviceinfo.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/serialbus/qcanbusdeviceinfo.h b/src/serialbus/qcanbusdeviceinfo.h
index 9503b0f..7b80400 100644
--- a/src/serialbus/qcanbusdeviceinfo.h
+++ b/src/serialbus/qcanbusdeviceinfo.h
@@ -57,7 +57,7 @@ public:
void swap(QCanBusDeviceInfo &other) noexcept
{
- qSwap(d_ptr, other.d_ptr);
+ d_ptr.swap(other.d_ptr);
}
QCanBusDeviceInfo &operator=(const QCanBusDeviceInfo &other);