From 05d9cc409c7ddffcd981c0dafaf67ba6935cc0ba Mon Sep 17 00:00:00 2001 From: Anton Lundin Date: Wed, 14 May 2014 00:32:45 +0200 Subject: Migrate code to for_each_dive and for_each_dc [Dirk Hohndel: this overlapped with my commit 09e7c61feeea ("Consistently use for_each_dive (and use it correctly)") so I took the pieces that I had missed] Signed-off-by: Anton Lundin Signed-off-by: Dirk Hohndel --- statistics.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'statistics.c') diff --git a/statistics.c b/statistics.c index feb812766..71150159c 100644 --- a/statistics.c +++ b/statistics.c @@ -294,12 +294,12 @@ void get_selected_dives_text(char *buffer, int size) static bool is_gas_used(struct dive *dive, int idx) { - struct divecomputer *dc = &dive->dc; + struct divecomputer *dc; bool firstGasExplicit = false; if (cylinder_none(&dive->cylinder[idx])) return false; - while (dc) { + for_each_dc(dive, dc) { struct event *event = get_next_event(dc->events, "gaschange"); while (event) { if (event->time.seconds < 30) @@ -308,7 +308,6 @@ static bool is_gas_used(struct dive *dive, int idx) return true; event = get_next_event(event->next, "gaschange"); } - dc = dc->next; } if (idx == 0 && !firstGasExplicit) return true; -- cgit v1.2.3-70-g09d2