diff options
author | Marc Mutz <marc.mutz@qt.io> | 2022-05-11 17:18:34 +0200 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2022-05-11 18:27:49 +0000 |
commit | 554368b40d8e7eb3ad80d2d6980a3735bb1aa5a1 (patch) | |
tree | c63a62b990cc645854371423af5d836b0576ebc1 /src | |
parent | cfd59f57bc247bcbb5c382179b457f641d50a4b7 (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>
Diffstat (limited to 'src')
-rw-r--r-- | src/serialbus/qcanbusdeviceinfo.h | 2 |
1 files changed, 1 insertions, 1 deletions
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); |