[Differential] [Commented On] D1588: [Shell] Replace foreach by range-for where possible

apol (Aleix Pol Gonzalez) noreply at phabricator.kde.org
Wed May 11 20:04:56 UTC 2016


apol added a comment.


  In https://phabricator.kde.org/D1588#29377, @davidedmundson wrote:
  
  > maybe we can, but why?
  >
  > foreach is always correct
  >
  > for is sometimes correct
  >
  > what's the benefit?
  
  
  I tend to think along those lines... if it was actually a problem, it could just be specified as:
  
    #define Q_FOREACH(a, b) for((a) : qAsConst(b))
  
  And live happily ever after. Or at least, until they fix the weird copies. FWIW, it's discussed in qt-development@ as we're speaking.
  A direct improvement is about 100bytes less of generated code for every foreach (which then needs to be executed).

REPOSITORY
  rPLASMAWORKSPACE Plasma Workspace

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

EMAIL PREFERENCES
  https://phabricator.kde.org/settings/panel/emailpreferences/

To: broulik, Plasma
Cc: apol, davidedmundson, plasma-devel, sebas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/plasma-devel/attachments/20160511/8f7ec5c5/attachment.html>


More information about the Plasma-devel mailing list