From e1caae0111f04e19a7f14bab81f933eeab41b623 Mon Sep 17 00:00:00 2001 From: Berthold Stoeger Date: Sun, 3 Mar 2019 15:18:00 +0100 Subject: Cleanup: let get_dive_site_idx() compare pointers The code used dive site uuids, which are not really used anymore. The only caller of this function does certainly not use a copy, so let's compare pointers instead. Signed-off-by: Berthold Stoeger --- core/divesite.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'core') diff --git a/core/divesite.c b/core/divesite.c index bf99ed395..d77e6ef72 100644 --- a/core/divesite.c +++ b/core/divesite.c @@ -14,10 +14,10 @@ int get_divesite_idx(const struct dive_site *ds, struct dive_site_table *ds_tabl { int i; const struct dive_site *d; - // tempting as it may be, don't die when called with dive=NULL + // tempting as it may be, don't die when called with ds=NULL if (ds) for_each_dive_site(i, d, ds_table) { - if (d->uuid == ds->uuid) // don't compare pointers, we could be passing in a copy of the dive + if (d == ds) return i; } return -1; -- cgit v1.2.3-70-g09d2