From c26e922802826dc9e2f044312cc33d5a037f6a10 Mon Sep 17 00:00:00 2001 From: Berthold Stoeger Date: Sun, 4 Aug 2019 19:17:11 +0200 Subject: Cleanup: return cylinder from add_empty_cylinder() As a convenience, return the cylinder from add_empty_cylinder() to spare the caller from the nasty expression to fetch the last cylinder. Signed-off-by: Berthold Stoeger --- core/parse.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'core/parse.c') diff --git a/core/parse.c b/core/parse.c index 8a07ba818..30d6a8ad5 100644 --- a/core/parse.c +++ b/core/parse.c @@ -289,8 +289,7 @@ void picture_end(struct parser_state *state) cylinder_t *cylinder_start(struct parser_state *state) { - add_empty_cylinder(&state->cur_dive->cylinders); - return &state->cur_dive->cylinders.cylinders[state->cur_dive->cylinders.nr - 1]; + return add_empty_cylinder(&state->cur_dive->cylinders); } void cylinder_end(struct parser_state *state) -- cgit v1.2.3-70-g09d2