diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2017-07-22 08:28:39 -0700 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2017-07-22 10:38:00 -0700 |
commit | b9f52d0aff470991568a7c1af5af529b0142e1e8 (patch) | |
tree | e0a58210472a0e7a62308fa56333e5f4095b44bd /core/statistics.c | |
parent | f2a6a76b3e64858691dda623873b2d40c1e98add (diff) | |
download | subsurface-b9f52d0aff470991568a7c1af5af529b0142e1e8.tar.gz |
Gas usage statistics: don't require gas switch events
Our "get_has_used()" helper only filled in gas usage for cylinders that
had a gas change event associated with them. That works really badly
for things like CCR, but also simply for cases where the dive computer
wasn't necessarily explicitly notified about usage, like sidemount
diving etc.
Just remove the logic. If some use ends up particularly wanting to
ignore some cylinder, they can always do it in the caller instead.
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'core/statistics.c')
-rw-r--r-- | core/statistics.c | 12 |
1 files changed, 0 insertions, 12 deletions
diff --git a/core/statistics.c b/core/statistics.c index d86fe6324..ff8122124 100644 --- a/core/statistics.c +++ b/core/statistics.c @@ -345,23 +345,11 @@ void get_gas_used(struct dive *dive, volume_t gases[MAX_CYLINDERS]) { int idx; struct divecomputer *dc; - bool used; for (idx = 0; idx < MAX_CYLINDERS; idx++) { - used = false; cylinder_t *cyl = &dive->cylinder[idx]; pressure_t start, end; - for_each_dc(dive, dc) { - if (same_string(dc->model, "planned dive")) - continue; - if (has_gaschange_event(dive, dc, idx)) - used = true; - } - - if (!used) - continue; - start = cyl->start.mbar ? cyl->start : cyl->sample_start; end = cyl->end.mbar ? cyl->end : cyl->sample_end; if (end.mbar && start.mbar > end.mbar) |