aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Berthold Stoeger <bstoeger@mail.tuwien.ac.at>2018-11-03 17:32:20 +0100
committerGravatar Dirk Hohndel <dirk@hohndel.org>2018-11-04 08:04:27 -0800
commita2b3d0ff0604fde45c1b2efe5fd8d0ca6c410e76 (patch)
tree4e2664c216d18e8bed0fa1061670a060311b1389
parent76f38ff33b918d4880614ff277b4b611c0ce2998 (diff)
downloadsubsurface-a2b3d0ff0604fde45c1b2efe5fd8d0ca6c410e76.tar.gz
Undo: fix addition of multiple dives
The generic addInBatches() function is used to add batches of contiguous sets of dives to the dive-list models. The loop searching for the end of the batch used the wrong index and would therefore not properly cut the batches. Fix this. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
-rw-r--r--qt-models/divetripmodel.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/qt-models/divetripmodel.cpp b/qt-models/divetripmodel.cpp
index 5cbb6a118..33f0dd46c 100644
--- a/qt-models/divetripmodel.cpp
+++ b/qt-models/divetripmodel.cpp
@@ -717,7 +717,7 @@ void addInBatches(Vector1 &v1, const Vector2 &v2, Comparator comp, Inserter inse
// We were at end -> insert the remaining items
j = v2.size();
} else {
- for (j = i + 1; j < (int)v2.size() && comp(v2[i], v1[idx]); ++j)
+ for (j = i + 1; j < (int)v2.size() && comp(v2[j], v1[idx]); ++j)
; // Pass
}