diff options
author | Tim Segers <tsegers@pm.me> | 2022-10-13 23:40:15 +0200 |
---|---|---|
committer | Tim Segers <tsegers@pm.me> | 2022-10-13 23:40:15 +0200 |
commit | 9171c1be91b6ecdc29e04c41dd2d64ad97340198 (patch) | |
tree | ffcfe1db73efe19112da3f3f67416753d8d7a742 /src/schedule.c | |
parent | cd4759ee3d43e5a3afcc6e60cc45c36d184cffa7 (diff) | |
download | opendeco-9171c1be91b6ecdc29e04c41dd2d64ad97340198.tar.gz |
Remove unused variable from simulate_dive
Diffstat (limited to 'src/schedule.c')
-rw-r--r-- | src/schedule.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/src/schedule.c b/src/schedule.c index 4b540fd..8f15813 100644 --- a/src/schedule.c +++ b/src/schedule.c @@ -57,19 +57,18 @@ int direct_ascent(const decostate_t *ds, const double depth, const double time, void simulate_dive(decostate_t *ds, waypoint_t *waypoints, const int nof_waypoints, waypoint_callback_t wp_cb) { double depth = abs_depth(0); - double runtime = 0; for (int i = 0; i < nof_waypoints; i++) { double d = waypoints[i].depth; double t = waypoints[i].time; const gas_t *g = waypoints[i].gas; - if (d != depth) { - runtime += add_segment_ascdec(ds, depth, d, t, g); - depth = d; - } else { - runtime += add_segment_const(ds, d, t, g); - } + if (d != depth) + add_segment_ascdec(ds, depth, d, t, g); + else + add_segment_const(ds, d, t, g); + + depth = d; if (wp_cb) wp_cb(ds, (waypoint_t){.depth = d, .time = t, .gas = g}, SEG_DIVE); |