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 --- divecomputer.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'divecomputer.cpp') diff --git a/divecomputer.cpp b/divecomputer.cpp index 6044f1aa6..c714137a2 100644 --- a/divecomputer.cpp +++ b/divecomputer.cpp @@ -162,9 +162,9 @@ extern "C" void set_dc_nickname(struct dive *dive) if (!dive) return; - struct divecomputer *dc = &dive->dc; + struct divecomputer *dc; - while (dc) { + for_each_dc(dive, dc) { if (dc->model && *dc->model && dc->deviceid && !dcList.getExact(dc->model, dc->deviceid)) { // we don't have this one, yet @@ -181,6 +181,5 @@ extern "C" void set_dc_nickname(struct dive *dive) dcList.addDC(dc->model, dc->deviceid); } } - dc = dc->next; } } -- cgit v1.2.3-70-g09d2