diff options
author | Anton Kudryavtsev <a.kudryavtsev@netris.ru> | 2016-09-08 14:24:06 +0300 |
---|---|---|
committer | Anton Kudryavtsev <a.kudryavtsev@netris.ru> | 2016-10-07 13:46:47 +0000 |
commit | d9b6b259068a5c6d32db8c32b60ea4903587103b (patch) | |
tree | 23823d996e057e4e42bb4ea5f6eca28e9cacdf9a /src/qml/types/qqmlinstantiator.cpp | |
parent | d83f4aca1ebca26f9025628a42eec5ed19cbf1eb (diff) |
Qml types: replace 'foreach' with 'range for'
Not all, just instances with low risk.
Change-Id: I30612a1debd83dfa01aa087799658cff254bc9fc
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Diffstat (limited to 'src/qml/types/qqmlinstantiator.cpp')
-rw-r--r-- | src/qml/types/qqmlinstantiator.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/qml/types/qqmlinstantiator.cpp b/src/qml/types/qqmlinstantiator.cpp index 0cec39790d..2de5875deb 100644 --- a/src/qml/types/qqmlinstantiator.cpp +++ b/src/qml/types/qqmlinstantiator.cpp @@ -155,7 +155,8 @@ void QQmlInstantiatorPrivate::_q_modelUpdated(const QQmlChangeSet &changeSet, bo int difference = 0; QHash<int, QVector<QPointer<QObject> > > moved; - foreach (const QQmlChangeSet::Change &remove, changeSet.removes()) { + const QVector<QQmlChangeSet::Change> &removes = changeSet.removes(); + for (const QQmlChangeSet::Change &remove : removes) { int index = qMin(remove.index, objects.count()); int count = qMin(remove.index + remove.count, objects.count()) - index; if (remove.isMove()) { @@ -174,7 +175,8 @@ void QQmlInstantiatorPrivate::_q_modelUpdated(const QQmlChangeSet &changeSet, bo difference -= remove.count; } - foreach (const QQmlChangeSet::Change &insert, changeSet.inserts()) { + const QVector<QQmlChangeSet::Change> &inserts = changeSet.inserts(); + for (const QQmlChangeSet::Change &insert : inserts) { int index = qMin(insert.index, objects.count()); if (insert.isMove()) { QVector<QPointer<QObject> > movedObjects = moved.value(insert.moveId); |