From 554368b40d8e7eb3ad80d2d6980a3735bb1aa5a1 Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Wed, 11 May 2022 17:18:34 +0200 Subject: QtSerialBus: replace qSwap with std::member-swap where possible MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 (cherry picked from commit fe7cd7255f82b3884651045422192bd7960cb0be) Reviewed-by: Qt Cherry-pick Bot --- src/serialbus/qcanbusdeviceinfo.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/serialbus/qcanbusdeviceinfo.h b/src/serialbus/qcanbusdeviceinfo.h index 80178bd..5fde8b8 100644 --- a/src/serialbus/qcanbusdeviceinfo.h +++ b/src/serialbus/qcanbusdeviceinfo.h @@ -54,7 +54,7 @@ public: void swap(QCanBusDeviceInfo &other) Q_DECL_NOTHROW { - qSwap(d_ptr, other.d_ptr); + d_ptr.swap(other.d_ptr); } QCanBusDeviceInfo &operator=(const QCanBusDeviceInfo &other); -- cgit v1.2.3