summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/xcb/qxcbconnection_xi2.cpp
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@kdab.com>2016-01-26 19:45:58 +0100
committerMarc Mutz <marc.mutz@kdab.com>2016-04-27 15:29:24 +0000
commit369572f892a5e748098c038b76b0f4331d2dd201 (patch)
tree081718df7b583ef23808bcb6918805a4f11716df /src/plugins/platforms/xcb/qxcbconnection_xi2.cpp
parent4077e28daa55652d7ada776b2702341125516caf (diff)
xcb: don't iterate over .keys()
... iterate over the container itself instead. Avoids temporary QList creation as well as the lookup cost when actually calling value(key). Saves more than 1KiB in text size on optimized GCC 6.0 Linux AMD64 builds. Change-Id: If4b2fb7eada0e9cde72ab101a5f6e5cb1ba64054 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
Diffstat (limited to 'src/plugins/platforms/xcb/qxcbconnection_xi2.cpp')
-rw-r--r--src/plugins/platforms/xcb/qxcbconnection_xi2.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/plugins/platforms/xcb/qxcbconnection_xi2.cpp b/src/plugins/platforms/xcb/qxcbconnection_xi2.cpp
index 46a26877c9..11577ba1f4 100644
--- a/src/plugins/platforms/xcb/qxcbconnection_xi2.cpp
+++ b/src/plugins/platforms/xcb/qxcbconnection_xi2.cpp
@@ -833,9 +833,8 @@ void QXcbConnection::xi2HandleHierachyEvent(void *event)
return;
xi2SetupDevices();
// Reselect events for all event-listening windows.
- Q_FOREACH (xcb_window_t window, m_mapper.keys()) {
- xi2Select(window);
- }
+ for (auto it = m_mapper.cbegin(), end = m_mapper.cend(); it != end; ++it)
+ xi2Select(it.key());
}
void QXcbConnection::xi2HandleDeviceChangedEvent(void *event)