diff options
author | Marc Mutz <marc.mutz@kdab.com> | 2019-05-17 11:38:48 +0200 |
---|---|---|
committer | Marc Mutz <marc.mutz@kdab.com> | 2019-05-17 11:45:47 +0200 |
commit | c5e889bf90b255db3597cbcb5e21e8843f4b5365 (patch) | |
tree | fd6b27a8a58dd36bce56e61b80148ea308161881 /tests | |
parent | 993863c4527f0565a77d7728446f954732a3c2b8 (diff) | |
download | qtwayland-c5e889bf90b255db3597cbcb5e21e8843f4b5365.tar.gz |
Use some qExchange()
This makes the code more compact and avoids any doubts regarding
accesses to the underlying container under iteration, if any.
Change-Id: I6cf8a6113f182ae5c4401cb44fce2a3904c67489
Reviewed-by: Johan Helsing <johan.helsing@qt.io>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/client/shared_old/mocksurface.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/tests/auto/client/shared_old/mocksurface.cpp b/tests/auto/client/shared_old/mocksurface.cpp index 81a5edbd..e9df5f90 100644 --- a/tests/auto/client/shared_old/mocksurface.cpp +++ b/tests/auto/client/shared_old/mocksurface.cpp @@ -149,11 +149,10 @@ void Surface::surface_commit(Resource *resource) } } - foreach (wl_resource *frameCallback, m_frameCallbackList) { + for (wl_resource *frameCallback : qExchange(m_frameCallbackList, {})) { wl_callback_send_done(frameCallback, m_compositor->time()); wl_resource_destroy(frameCallback); } - m_frameCallbackList.clear(); } } |