summaryrefslogtreecommitdiffstats
path: root/qthelper.cpp
diff options
context:
space:
mode:
authorGravatar Tomaz Canabrava <tomaz.canabrava@intel.com>2014-05-10 22:12:40 -0300
committerGravatar Dirk Hohndel <dirk@hohndel.org>2014-05-11 01:57:35 -0700
commit25e0fdcb162d9ede9a4a49b36d05f0b77ece1056 (patch)
treed632183c7615edfaedccde70fb7e11555f6459c6 /qthelper.cpp
parent4b8a66f4899cb337899ec1d35058ab7fc1b1bc86 (diff)
downloadsubsurface-25e0fdcb162d9ede9a4a49b36d05f0b77ece1056.tar.gz
use for_each_dive instead of hand-written loop.
It's easyer to make a mistake in the loop insteaf of using the currently correct one that's already written Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qthelper.cpp')
-rw-r--r--qthelper.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/qthelper.cpp b/qthelper.cpp
index 894601c80..2cecb9774 100644
--- a/qthelper.cpp
+++ b/qthelper.cpp
@@ -246,8 +246,9 @@ bool gpsHasChanged(struct dive *dive, struct dive *master, const QString &gps_te
QList<int> getDivesInTrip(dive_trip_t *trip)
{
QList<int> ret;
- for (int i = 0; i < dive_table.nr; i++) {
- struct dive *d = get_dive(i);
+ int i;
+ struct dive *d;
+ for_each_dive (i, d) {
if (d->divetrip == trip) {
ret.push_back(get_divenr(d));
}