summaryrefslogtreecommitdiffstats
path: root/core/parse.c
diff options
context:
space:
mode:
authorGravatar Berthold Stoeger <bstoeger@mail.tuwien.ac.at>2019-08-04 19:17:11 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2019-11-09 19:19:04 +0100
commitc26e922802826dc9e2f044312cc33d5a037f6a10 (patch)
treea1fc9c98acd90261b1d3bca46932d438d7fd7f7e /core/parse.c
parent8df3705152aa32d8551b5fb7db08e0c8e442b480 (diff)
downloadsubsurface-c26e922802826dc9e2f044312cc33d5a037f6a10.tar.gz
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 <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'core/parse.c')
-rw-r--r--core/parse.c3
1 files changed, 1 insertions, 2 deletions
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)