D17028: Loader: Avoid Q_FOREACH

loh tar noreply at phabricator.kde.org
Tue Nov 20 15:49:18 GMT 2018


loh.tar added inline comments.

INLINE COMMENTS

> smartins wrote in loader.cpp:273
> will languages() detach ?

Probably, yes. But Qt docu always says, "thanks to implicit sharing copying a container is very fast"

Is copy previous into a const var a benefit (as I have seen recently)? Don't think so. Or would iterate by index avoid that? (It's a QStringList) I don't know. Guess the problem remains. You need to keep a copy.

I think I read something like, "Don't worry when using a function return value", but can't find it anymore. So, perhaps it was my conclusion from here: http://doc.qt.io/qt-5/qtglobal.html#qAsConst

Reads similar to me: https://www.kdab.com/goodbye-q_foreach/

Let me know what you like to see, will do it.

REPOSITORY
  R246 Sonnet

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

To: loh.tar, davidedmundson
Cc: smartins, kde-frameworks-devel, michaelh, ngraham, bruns
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20181120/778ea3ba/attachment.html>


More information about the Kde-frameworks-devel mailing list