diff options
author | Berthold Stoeger <bstoeger@mail.tuwien.ac.at> | 2020-09-06 13:27:00 +0200 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2020-09-06 12:59:54 -0700 |
commit | e5923a105a4faafa872c7d3b33c6d74f49ed7fe0 (patch) | |
tree | 1684e18c353eb8e4a37cb75ea7ee7333d9600597 /core | |
parent | 754b4a5c9df088015a3f9dc504d51c3108bc7450 (diff) | |
download | subsurface-e5923a105a4faafa872c7d3b33c6d74f49ed7fe0.tar.gz |
cleanup: use taxonomy_get_country() in get_dive_country()
get_dive_country() was essentially a reimplementation of taxonomy_get_country().
Let's just use the already existing function.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'core')
-rw-r--r-- | core/dive.c | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/core/dive.c b/core/dive.c index 49a468e5a..2408ba57c 100644 --- a/core/dive.c +++ b/core/dive.c @@ -3797,12 +3797,7 @@ struct dive_site *get_dive_site_for_dive(const struct dive *dive) const char *get_dive_country(const struct dive *dive) { struct dive_site *ds = dive->dive_site; - if (ds) { - int idx = taxonomy_index_for_category(&ds->taxonomy, TC_COUNTRY); - if (idx >= 0) - return ds->taxonomy.category[idx].value; - } - return NULL; + return ds ? taxonomy_get_country(&ds->taxonomy) : NULL; } const char *get_dive_location(const struct dive *dive) |