D23010: Use range loop if possible

Christoph Cullmann noreply at phabricator.kde.org
Wed Aug 7 20:51:39 BST 2019


cullmann requested changes to this revision.
cullmann added a comment.
This revision now requires changes to proceed.


  I think if we touch all this, we should use in some places qAsConst (or const ... local variable) to avoid detach, see more detailed explanation here:
  
  https://www.kdab.com/goodbye-q_foreach/
  
  (that howto is for a different kind of conversion but the hints for qAsConst are ok for this, too)
  
  e.g.
  
  QStringList children = config.readEntry("Children", QStringList());
  for (const auto& str : children) {
  
  >
  =
  
  const QStringList children = config.readEntry("Children", QStringList());
  for (const auto& str : children) {
  
  or
  
  for (auto& pluginInfo : m_pluginList) {
  
  >
  =
  
  for (auto& pluginInfo : qAsConst(m_pluginList)) {

REPOSITORY
  R40 Kate

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

To: gawin, #kate, cullmann
Cc: cullmann, kwrite-devel, #kate, univerz, domson, michaelh, ngraham, demsking, sars, dhaumann
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kwrite-devel/attachments/20190807/0ac5004f/attachment.html>


More information about the KWrite-Devel mailing list