From 25e0fdcb162d9ede9a4a49b36d05f0b77ece1056 Mon Sep 17 00:00:00 2001 From: Tomaz Canabrava Date: Sat, 10 May 2014 22:12:40 -0300 Subject: 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 Signed-off-by: Dirk Hohndel --- qthelper.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'qthelper.cpp') 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 getDivesInTrip(dive_trip_t *trip) { QList 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)); } -- cgit v1.2.3-70-g09d2