aboutsummaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorGravatar Berthold Stoeger <bstoeger@mail.tuwien.ac.at>2019-03-03 15:18:00 +0100
committerGravatar Dirk Hohndel <dirk@hohndel.org>2019-04-12 18:19:07 +0300
commite1caae0111f04e19a7f14bab81f933eeab41b623 (patch)
tree510f9b2bcabf7af0cfe2ea3f26fc963619dd581f /core
parent82af1b2377cec03a989f86b8009d4ac226c6541e (diff)
downloadsubsurface-e1caae0111f04e19a7f14bab81f933eeab41b623.tar.gz
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 <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'core')
-rw-r--r--core/divesite.c4
1 files changed, 2 insertions, 2 deletions
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;