D23839: Port away from Qt's foreach

Friedrich W. H. Kossebau noreply at phabricator.kde.org
Tue Sep 10 16:58:23 BST 2019


kossebau added inline comments.

INLINE COMMENTS

> zzag wrote in kwindowsystem_threadtest.cpp:61
> I asked that because `for (const Type &item : collection) {` is more common. I know that const ref doesn't have any advantages here.

(Gah, phab ate this comment before, rewriting)
Getting the item by value though is also common, for types which are trivially copyable and fit in cpu registers on usual hardware. Which is some ยต-opt that might make sense to get used to as code pattern by using it as default in such cases, to approach what they call "premature pessimation".
Your code though and not performance crititcal, so doing as you prefer.

REPOSITORY
  R278 KWindowSystem

REVISION DETAIL
  https://phabricator.kde.org/D23839

To: kossebau, #kwin, zzag
Cc: aacid, kde-frameworks-devel, LeGast00n, GB_2, michaelh, ngraham, bruns
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20190910/ce14022f/attachment.html>


More information about the Kde-frameworks-devel mailing list