Replace qExchange with std::exchange

None of these users require C++20 constexpr or C++23 noexcept, the
only remaining difference between std::exchange and qExchange.

Task-number: QTBUG-99313
Change-Id: Ic5a0bd36d715af2cbc5f9936fdff665ee6eeea4e
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: David Edmundson <davidedmundson@kde.org>
This commit is contained in:
Marc Mutz 2022-10-06 07:07:55 +02:00
parent ece18f7ce2
commit bebf43bcc8
2 changed files with 3 additions and 3 deletions

View File

@ -345,9 +345,9 @@ QWaylandDisplay::~QWaylandDisplay(void)
if (mSyncCallback)
wl_callback_destroy(mSyncCallback);
qDeleteAll(qExchange(mInputDevices, {}));
qDeleteAll(std::exchange(mInputDevices, {}));
for (QWaylandScreen *screen : qExchange(mScreens, {})) {
for (QWaylandScreen *screen : std::exchange(mScreens, {})) {
QWindowSystemInterface::handleScreenRemoved(screen);
}
qDeleteAll(mWaitingScreens);

View File

@ -109,7 +109,7 @@ void Surface::surface_commit(Resource *resource)
}
}
for (wl_resource *frameCallback : qExchange(m_frameCallbackList, {})) {
for (wl_resource *frameCallback : std::exchange(m_frameCallbackList, {})) {
auto time = m_wlCompositor->m_compositor->currentTimeMilliseconds();
wl_callback_send_done(frameCallback, time);
wl_resource_destroy(frameCallback);