~haggai-eran/unity-2d/rtl-rebased

« back to all changes in this revision

Viewing changes to panel/applets/appindicator/appindicatorapplet.cpp

  • Committer: Tarmac
  • Author(s): Albert Astals
  • Date: 2011-11-24 15:34:03 UTC
  • mfrom: (789.1.1 foreachconstref)
  • Revision ID: tarmac-20111124153403-p037jibq133f9ip4
[code] Add const & for foreach "iterators"

Avoids a copy of each object. It is true that most of those objects are
implicitly shared so the win isn't huge but we still save some atomic/mutex/something locking

Show diffs side-by-side

added added

removed removed

Lines of Context:
67
67
void AppIndicatorApplet::createItems()
68
68
{
69
69
    QStringList ids = m_watcher->property("RegisteredStatusNotifierItems").toStringList();
70
 
    Q_FOREACH(QString id, ids) {
 
70
    Q_FOREACH(const QString& id, ids) {
71
71
        createItem(id);
72
72
    }
73
73
}