cleanup: remove unused function

The last caller of find_cylinder_index() was removed in
3629a87fcc. Also remove functions that where only called by
this function.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2022-08-27 16:36:45 +02:00 committed by Dirk Hohndel
parent 70fbce46c7
commit 5be01b04ed

View file

@ -1177,35 +1177,12 @@ static bool same_cylinder_size(const cylinder_t &cyl1, const cylinder_t &cyl2)
cyl1.type.workingpressure.mbar == cyl2.type.workingpressure.mbar;
}
static bool same_cylinder_pressure(const cylinder_t &cyl1, const cylinder_t &cyl2)
{
return cyl1.start.mbar == cyl2.start.mbar &&
cyl1.end.mbar == cyl2.end.mbar;
}
// Flags for comparing cylinders
static constexpr int SAME_TYPE = 1 << 0;
static constexpr int SAME_SIZE = 1 << 1;
static constexpr int SAME_PRESS = 1 << 2;
static constexpr int SAME_GAS = 1 << 3;
static bool same_cylinder_with_flags(const cylinder_t &cyl1, const cylinder_t &cyl2, int sameCylinderFlags)
{
return (((sameCylinderFlags & SAME_TYPE) == 0 || same_cylinder_type(cyl1, cyl2)) &&
((sameCylinderFlags & SAME_SIZE) == 0 || same_cylinder_size(cyl1, cyl2)) &&
((sameCylinderFlags & SAME_PRESS) == 0 || same_cylinder_pressure(cyl1, cyl2)) &&
((sameCylinderFlags & SAME_GAS) == 0 || same_gasmix(cyl1.gasmix, cyl2.gasmix)));
}
static int find_cylinder_index(const struct dive *d, const cylinder_t &cyl, int sameCylinderFlags)
{
for (int idx = 0; idx < d->cylinders.nr; ++idx) {
if (same_cylinder_with_flags(cyl, *get_cylinder(d, idx), sameCylinderFlags))
return idx;
}
return -1;
}
EditCylinderBase::EditCylinderBase(int index, bool currentDiveOnly, bool nonProtectedOnly, int sameCylinderFlags) :
EditDivesBase(currentDiveOnly)
{