summaryrefslogtreecommitdiffstats
path: root/core/divelist.c
diff options
context:
space:
mode:
authorGravatar Berthold Stoeger <bstoeger@mail.tuwien.ac.at>2018-08-16 17:11:51 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2018-08-23 05:16:38 -0700
commit5c4569247a31cf9f52238bd2b3f9c87b8f79933a (patch)
tree2e6216fafc0b42fb6eac368e58b01136e4f2bcc7 /core/divelist.c
parentf5b11daffd6f240268ce78d72c64be43670988ea (diff)
downloadsubsurface-5c4569247a31cf9f52238bd2b3f9c87b8f79933a.tar.gz
Cleanup: unify get_gas_at_time() and get_gasmix()
There were two functions for getting gas-mixes at a certain timestamp: - get_gasmix() for repeated queries. - get_gas_at_time() for a single query. Since the latter is a special case of the former, simply call the former in the latter. Moreover, rename to get_gasmix_at_time() for consistency. Replace on get_gasmix() call, which was outside of a loop by the corresponding get_gasmix_at_time() call. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'core/divelist.c')
-rw-r--r--core/divelist.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/core/divelist.c b/core/divelist.c
index 9c2484417..12382d896 100644
--- a/core/divelist.c
+++ b/core/divelist.c
@@ -134,8 +134,7 @@ int total_weight(struct dive *dive)
static int active_o2(struct dive *dive, struct divecomputer *dc, duration_t time)
{
- struct gasmix gas;
- get_gas_at_time(dive, dc, time, &gas);
+ struct gasmix gas = get_gasmix_at_time(dive, dc, time);
return get_o2(&gas);
}