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>
bb10
Marc Mutz 2016-01-26 19:45:58 +01:00
parent 4077e28daa
commit 369572f892
1 changed files with 2 additions and 3 deletions

View File

@ -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)