mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
core: move set_weightsystem() to weightsystem_table
Feels natural in a C++ code base. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
650fda3221
commit
b5a4e7eb0b
3 changed files with 5 additions and 7 deletions
|
@ -318,11 +318,11 @@ void weightsystem_table::add(int idx, weightsystem_t ws)
|
|||
insert(begin() + idx, std::move(ws));
|
||||
}
|
||||
|
||||
void set_weightsystem(struct dive *dive, int idx, weightsystem_t ws)
|
||||
void weightsystem_table::set(int idx, weightsystem_t ws)
|
||||
{
|
||||
if (idx < 0 || static_cast<size_t>(idx) >= dive->weightsystems.size())
|
||||
if (idx < 0 || static_cast<size_t>(idx) >= size())
|
||||
return;
|
||||
dive->weightsystems[idx] = std::move(ws);
|
||||
(*this)[idx] = std::move(ws);
|
||||
}
|
||||
|
||||
/* when planning a dive we need to make sure that all cylinders have a sane depth assigned
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue