mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-30 22:20:21 +00:00
core: remove add_empty_cylinder()
This one-liner wasn't really doing anything and there was only one user of the return value. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
9bb2255ba8
commit
498302dcc6
4 changed files with 4 additions and 10 deletions
|
@ -366,7 +366,7 @@ cylinder_t *dive::get_or_create_cylinder(int idx)
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
while (static_cast<size_t>(idx) >= cylinders.size())
|
while (static_cast<size_t>(idx) >= cylinders.size())
|
||||||
add_empty_cylinder(&cylinders);
|
cylinders.emplace_back();
|
||||||
return &cylinders[idx];
|
return &cylinders[idx];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1075,7 +1075,7 @@ static void fixup_dc_sample_sensors(struct dive &dive, struct divecomputer &dc)
|
||||||
|
|
||||||
// Do we need to add empty cylinders?
|
// Do we need to add empty cylinders?
|
||||||
while (sensor_mask) {
|
while (sensor_mask) {
|
||||||
add_empty_cylinder(&dive.cylinders);
|
dive.cylinders.emplace_back();
|
||||||
sensor_mask >>= 1;
|
sensor_mask >>= 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -363,12 +363,6 @@ void copy_cylinder_types(const struct dive *s, struct dive *d)
|
||||||
d->cylinders.push_back(s->cylinders[i]);
|
d->cylinders.push_back(s->cylinders[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
cylinder_t *add_empty_cylinder(struct cylinder_table *t)
|
|
||||||
{
|
|
||||||
t->emplace_back();
|
|
||||||
return &t->back();
|
|
||||||
}
|
|
||||||
|
|
||||||
/* if a default cylinder is set, use that */
|
/* if a default cylinder is set, use that */
|
||||||
void fill_default_cylinder(const struct dive *dive, cylinder_t *cyl)
|
void fill_default_cylinder(const struct dive *dive, cylinder_t *cyl)
|
||||||
{
|
{
|
||||||
|
|
|
@ -72,7 +72,6 @@ using weightsystem_table = std::vector<weightsystem_t>;
|
||||||
|
|
||||||
extern enum cylinderuse cylinderuse_from_text(const char *text);
|
extern enum cylinderuse cylinderuse_from_text(const char *text);
|
||||||
extern void copy_cylinder_types(const struct dive *s, struct dive *d);
|
extern void copy_cylinder_types(const struct dive *s, struct dive *d);
|
||||||
extern cylinder_t *add_empty_cylinder(struct cylinder_table *t);
|
|
||||||
extern void remove_cylinder(struct dive *dive, int idx);
|
extern void remove_cylinder(struct dive *dive, int idx);
|
||||||
extern void remove_weightsystem(struct dive *dive, int idx);
|
extern void remove_weightsystem(struct dive *dive, int idx);
|
||||||
extern void set_weightsystem(struct dive *dive, int idx, weightsystem_t ws);
|
extern void set_weightsystem(struct dive *dive, int idx, weightsystem_t ws);
|
||||||
|
|
|
@ -300,7 +300,8 @@ void picture_end(struct parser_state *state)
|
||||||
|
|
||||||
cylinder_t *cylinder_start(struct parser_state *state)
|
cylinder_t *cylinder_start(struct parser_state *state)
|
||||||
{
|
{
|
||||||
return add_empty_cylinder(&state->cur_dive->cylinders);
|
state->cur_dive->cylinders.emplace_back();
|
||||||
|
return &state->cur_dive->cylinders.back();
|
||||||
}
|
}
|
||||||
|
|
||||||
void cylinder_end(struct parser_state *state)
|
void cylinder_end(struct parser_state *state)
|
||||||
|
|
Loading…
Reference in a new issue