From 9171c1be91b6ecdc29e04c41dd2d64ad97340198 Mon Sep 17 00:00:00 2001 From: Tim Segers Date: Thu, 13 Oct 2022 23:40:15 +0200 Subject: Remove unused variable from simulate_dive --- src/schedule.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'src/schedule.c') 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); -- cgit v1.2.3-70-g09d2