diff options
author | Daniel Pfeifer <daniel@pfeifer-mail.de> | 2017-05-04 20:19:23 (GMT) |
---|---|---|
committer | Daniel Pfeifer <daniel@pfeifer-mail.de> | 2017-05-05 07:21:12 (GMT) |
commit | 377d4df2795ad501aa7a08cf5c2ac0ef1208c362 (patch) | |
tree | 0264e3c6d9c614ee615e98b16bf976b5d1ee2121 /Source/QtDialog | |
parent | a57b30bb6037977cb0c8023e758a0850915334eb (diff) | |
download | CMake-377d4df2795ad501aa7a08cf5c2ac0ef1208c362.zip CMake-377d4df2795ad501aa7a08cf5c2ac0ef1208c362.tar.gz CMake-377d4df2795ad501aa7a08cf5c2ac0ef1208c362.tar.bz2 |
QCMakeCacheView: avoid temporary containers for iteration
Diffstat (limited to 'Source/QtDialog')
-rw-r--r-- | Source/QtDialog/QCMakeCacheView.cxx | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/Source/QtDialog/QCMakeCacheView.cxx b/Source/QtDialog/QCMakeCacheView.cxx index 9f5208a..29f8daf 100644 --- a/Source/QtDialog/QCMakeCacheView.cxx +++ b/Source/QtDialog/QCMakeCacheView.cxx @@ -254,8 +254,11 @@ void QCMakeCacheModel::setProperties(const QCMakePropertyList& props) QStandardItem* root = this->invisibleRootItem(); - foreach (QString key, newPropsTree.keys()) { - QCMakePropertyList props2 = newPropsTree[key]; + for (QMap<QString, QCMakePropertyList>::const_iterator iter = + newPropsTree.begin(); + iter != newPropsTree.end(); ++iter) { + QString const& key = iter.key(); + QCMakePropertyList const& props2 = iter.value(); QList<QStandardItem*> parentItems; parentItems.append( @@ -280,8 +283,11 @@ void QCMakeCacheModel::setProperties(const QCMakePropertyList& props) } } - foreach (QString key, newPropsTree2.keys()) { - QCMakePropertyList props2 = newPropsTree2[key]; + for (QMap<QString, QCMakePropertyList>::const_iterator iter = + newPropsTree2.begin(); + iter != newPropsTree2.end(); ++iter) { + QString const& key = iter.key(); + QCMakePropertyList const& props2 = iter.value(); QStandardItem* parentItem = new QStandardItem(key.isEmpty() ? tr("Ungrouped Entries") : key); |