mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
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>
This commit is contained in:
parent
4b8a66f489
commit
25e0fdcb16
1 changed files with 3 additions and 2 deletions
|
@ -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> getDivesInTrip(dive_trip_t *trip)
|
||||||
{
|
{
|
||||||
QList<int> ret;
|
QList<int> ret;
|
||||||
for (int i = 0; i < dive_table.nr; i++) {
|
int i;
|
||||||
struct dive *d = get_dive(i);
|
struct dive *d;
|
||||||
|
for_each_dive (i, d) {
|
||||||
if (d->divetrip == trip) {
|
if (d->divetrip == trip) {
|
||||||
ret.push_back(get_divenr(d));
|
ret.push_back(get_divenr(d));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue