diff options
author | Berthold Stoeger <bstoeger@mail.tuwien.ac.at> | 2018-08-16 17:11:51 +0200 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2018-08-23 05:16:38 -0700 |
commit | 5c4569247a31cf9f52238bd2b3f9c87b8f79933a (patch) | |
tree | 2e6216fafc0b42fb6eac368e58b01136e4f2bcc7 /profile-widget | |
parent | f5b11daffd6f240268ce78d72c64be43670988ea (diff) | |
download | subsurface-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 'profile-widget')
-rw-r--r-- | profile-widget/profilewidget2.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/profile-widget/profilewidget2.cpp b/profile-widget/profilewidget2.cpp index d9875681a..9371047bd 100644 --- a/profile-widget/profilewidget2.cpp +++ b/profile-widget/profilewidget2.cpp @@ -758,8 +758,7 @@ void ProfileWidget2::plotDive(struct dive *d, bool force, bool doClearPictures) qDeleteAll(eventItems); eventItems.clear(); struct event *event = currentdc->events; - struct event *ev; - struct gasmix lastgasmix = get_gasmix(&displayed_dive, current_dc, 1, &ev, NULL); + struct gasmix lastgasmix = get_gasmix_at_time(&displayed_dive, current_dc, duration_t{1}); while (event) { #ifndef SUBSURFACE_MOBILE |