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>
This commit is contained in:
Berthold Stoeger 2019-08-04 19:17:11 +02:00 committed by Dirk Hohndel
parent 8df3705152
commit c26e922802
4 changed files with 5 additions and 7 deletions

View file

@ -2126,9 +2126,7 @@ static int match_cylinder(const cylinder_t *cyl, const struct dive *dive, const
*/
static void merge_one_cylinder(struct cylinder_table *t, const cylinder_t *a, const cylinder_t *b)
{
cylinder_t *res;
add_empty_cylinder(t);
res = t->cylinders + (t->nr - 1);
cylinder_t *res = add_empty_cylinder(t);
res->type.size.mliter = a->type.size.mliter ?
a->type.size.mliter : b->type.size.mliter;
res->type.workingpressure.mbar = a->type.workingpressure.mbar ?