graesslin added a subscriber: broulik. graesslin added inline comments. INLINE COMMENTS
> markg wrote in pointer_input.cpp:440 > Just curious, why do you define end as opposed tho this: > for (auto it = m_buttons.constBegin(); it != m_buttons.constEnd(); it++) { > > } > > Another route you can go which looks much cleaner imho (requires Qt 5.7 > because of qAsConst): > for (auto entry, qAsConst(m_buttons)) { > > } > > Just my 2 cents. > Just curious, why do you define end as opposed tho this: Because @broulik tends to point out that it is not cached. > Another route you can go which looks much cleaner imho (requires Qt 5.7 > because of qAsConst): does that work in a sensible way for a QHash? The most lean way would have been: if (std::any_of(m_buttons.constBegin(), m_buttons.constEnd(), [] ...)) But that doesn't work with QHash. So I kind of doubt QHash and qAsConst do something sensible. REPOSITORY R108 KWin REVISION DETAIL https://phabricator.kde.org/D5461 To: graesslin, #kwin, #plasma Cc: broulik, markg, plasma-devel, kwin, spstarr, progwolff, lesliezhai, ali-mohamed, hardening, jensreuterberg, abetts, sebas, apol