diff options
author | Marc Mutz <marc.mutz@qt.io> | 2022-05-11 16:50:46 +0200 |
---|---|---|
committer | Marc Mutz <marc.mutz@qt.io> | 2022-05-11 18:41:57 +0200 |
commit | 583b991120596a5fbfdfd726ec228c23e819107e (patch) | |
tree | 77f001905a2f5fd6415b9175156f97fdec52c965 /src/multimedia/audio | |
parent | 60b5194e05381dcd1104964d891325dd92c0b5e6 (diff) |
QtMultimedia: replace qSwap with std::swap/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: Ida8402522bc980e871455d8fb21dddcf5b2dd384
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: MÃ¥rten Nordheim <marten.nordheim@qt.io>
Diffstat (limited to 'src/multimedia/audio')
-rw-r--r-- | src/multimedia/audio/qaudiobuffer.h | 2 | ||||
-rw-r--r-- | src/multimedia/audio/qaudiodevice.h | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/src/multimedia/audio/qaudiobuffer.h b/src/multimedia/audio/qaudiobuffer.h index dad011750..624c8aabe 100644 --- a/src/multimedia/audio/qaudiobuffer.h +++ b/src/multimedia/audio/qaudiobuffer.h @@ -161,7 +161,7 @@ public: QAudioBuffer(QAudioBuffer &&other) noexcept = default; QT_MOVE_ASSIGNMENT_OPERATOR_IMPL_VIA_PURE_SWAP(QAudioBuffer) void swap(QAudioBuffer &other) noexcept - { qSwap(d, other.d); } + { d.swap(other.d); } bool isValid() const noexcept { return d != nullptr; }; diff --git a/src/multimedia/audio/qaudiodevice.h b/src/multimedia/audio/qaudiodevice.h index e871548a1..3098c6df1 100644 --- a/src/multimedia/audio/qaudiodevice.h +++ b/src/multimedia/audio/qaudiodevice.h @@ -79,7 +79,7 @@ public: QAudioDevice(QAudioDevice &&other) noexcept = default; QT_MOVE_ASSIGNMENT_OPERATOR_IMPL_VIA_PURE_SWAP(QAudioDevice) void swap(QAudioDevice &other) noexcept - { qSwap(d, other.d); } + { d.swap(other.d); } QAudioDevice& operator=(const QAudioDevice& other); |