aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/util
diff options
context:
space:
mode:
authorAndrew den Exter <andrew.den-exter@nokia.com>2012-08-09 10:24:50 +1000
committerQt by Nokia <qt-info@nokia.com>2012-08-27 02:01:31 +0200
commit4a161cfa0cf9167b575bdf7ff5685b9bf17c6960 (patch)
tree6ad010e526b4aedad0813e1680c0343f11817dc7 /src/quick/util
parent29c16206d9133d2341673b2943145941e88352e9 (diff)
Remove unreachable code paths from QQuickChangeSet.
In any circumstance these if statements would evaluate to true, a previous branch of the else if block will be taken first. Change-Id: I7f48769ebfbb1cf5105b875a63530d1c37056c11 Reviewed-by: Martin Jones <martin.jones@nokia.com>
Diffstat (limited to 'src/quick/util')
-rw-r--r--src/quick/util/qquickchangeset.cpp13
1 files changed, 4 insertions, 9 deletions
diff --git a/src/quick/util/qquickchangeset.cpp b/src/quick/util/qquickchangeset.cpp
index 23fa432367..8a26e5b9ab 100644
--- a/src/quick/util/qquickchangeset.cpp
+++ b/src/quick/util/qquickchangeset.cpp
@@ -303,10 +303,6 @@ void QQuickChangeSet::remove(QVector<Remove> *removes, QVector<Insert> *inserts)
} else if (rit->count == -offset || rit->count == 0) {
insert->index += difference;
break;
- } else if (offset <= 0) {
- insert->index = index - removeCount;
- insertCount += insert->count;
- ++insert;
} else {
insert->index -= removeCount - difference;
rit->index -= insert->count;
@@ -351,15 +347,14 @@ void QQuickChangeSet::remove(QVector<Remove> *removes, QVector<Insert> *inserts)
// Accumulate all existing non-move removes that are encapsulated by or immediately
// follow the current remove into it.
int difference = 0;
- if (rend == m_removes.end())
+ if (rend == m_removes.end()) {
difference = rit->count;
- else if (rit->index + rit->count < rend->index - removeCount)
+ } else if (rit->index + rit->count < rend->index - removeCount) {
difference = rit->count;
- else if (rend->moveId != -1) {
+ } else if (rend->moveId != -1) {
difference = rend->index - removeCount - rit->index;
index += difference;
- } else if (offset > 0)
- difference = offset;
+ }
count += difference;
rit->count -= difference;