From bebf43bcc8d4cda22fb0354af432acf7f57edf45 Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Thu, 6 Oct 2022 07:07:55 +0200 Subject: [PATCH] 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 Reviewed-by: David Edmundson --- src/plugins/platforms/wayland/qwaylanddisplay.cpp | 4 ++-- tests/auto/wayland/shared/coreprotocol.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/plugins/platforms/wayland/qwaylanddisplay.cpp b/src/plugins/platforms/wayland/qwaylanddisplay.cpp index 2d82f447ac4..275a4a1441f 100644 --- a/src/plugins/platforms/wayland/qwaylanddisplay.cpp +++ b/src/plugins/platforms/wayland/qwaylanddisplay.cpp @@ -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); diff --git a/tests/auto/wayland/shared/coreprotocol.cpp b/tests/auto/wayland/shared/coreprotocol.cpp index 88b8cb59830..559ddbd7dca 100644 --- a/tests/auto/wayland/shared/coreprotocol.cpp +++ b/tests/auto/wayland/shared/coreprotocol.cpp @@ -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);