D25755: Replace iterators with range-based for

Ahmad Samir noreply at phabricator.kde.org
Thu Dec 5 14:58:25 GMT 2019


ahmadsamir added a comment.


  If we're going to iterate over a whole container, from cbegin() to cend(), and the container isn't going to change in the loop, then IMHO (H for humble :)) range-for would convey the intention better and make the code slightly easier to read/look cleaner.
  
  Kind of like one of the main reasons foreach was used (in, as we're finding out now that we're removing it from KDE code, many many places) instead of iterator/index based for loops, to begin with.

REPOSITORY
  R297 KDED

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

To: nicolasfella, #frameworks
Cc: ahmadsamir, broulik, aacid, apol, 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/20191205/5d6cdb42/attachment.html>


More information about the Kde-frameworks-devel mailing list