From 724055f0af4fb7cdb9f1570967fe4b34797f3419 Mon Sep 17 00:00:00 2001 From: Berthold Stoeger Date: Fri, 26 Oct 2018 17:03:54 +0200 Subject: Dive site: replace dive->dive_site_uuid by dive_site Replace the UUID reference of struct dive by a pointer to dive_site. This commit is rather large in lines, but nevertheless quite simple since most of the UUID->pointer work was done in previous commits. Signed-off-by: Berthold Stoeger --- core/divesite.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'core/divesite.c') diff --git a/core/divesite.c b/core/divesite.c index 79902d1ef..726dec42d 100644 --- a/core/divesite.c +++ b/core/divesite.c @@ -138,7 +138,7 @@ int nr_of_dives_at_dive_site(struct dive_site *ds, bool select_only) if (!ds) return 0; for_each_dive(j, d) { - if (d->dive_site_uuid == ds->uuid && (!select_only || d->selected)) { + if (d->dive_site == ds && (!select_only || d->selected)) { nr++; } } @@ -153,7 +153,7 @@ bool is_dive_site_used(struct dive_site *ds, bool select_only) if (!ds) return false; for_each_dive(j, d) { - if (d->dive_site_uuid == ds->uuid && (!select_only || d->selected)) { + if (d->dive_site == ds && (!select_only || d->selected)) { found = true; break; } @@ -318,9 +318,9 @@ void merge_dive_sites(struct dive_site *ref, struct dive_site *dive_sites[], int continue; for_each_dive(curr_dive, d) { - if (d->dive_site_uuid != dive_sites[i]->uuid ) + if (d->dive_site != dive_sites[i] ) continue; - d->dive_site_uuid = ref->uuid; + d->dive_site = ref; invalidate_dive_cache(d); } } -- cgit v1.2.3-70-g09d2