mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
core: replace same_weightsystem() by operator==()
The important point is that this now takes a reference that avoid string copying. The old code used C-strings and therefore copy-semantics were OK. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
fb3a157462
commit
777e7f32a5
4 changed files with 8 additions and 7 deletions
|
@ -951,7 +951,7 @@ void AddWeight::redo()
|
|||
|
||||
static int find_weightsystem_index(const struct dive *d, const weightsystem_t &ws)
|
||||
{
|
||||
return index_of_if(d->weightsystems, [&ws](auto &ws2) { return same_weightsystem(ws2, ws); });
|
||||
return index_of_if(d->weightsystems, [&ws](auto &ws2) { return ws == ws2; });
|
||||
}
|
||||
|
||||
EditWeightBase::EditWeightBase(int index, bool currentDiveOnly) :
|
||||
|
@ -1047,7 +1047,7 @@ EditWeight::EditWeight(int index, weightsystem_t wsIn, bool currentDiveOnly) :
|
|||
new_ws.description = it->name;
|
||||
|
||||
// If that doesn't change anything, do nothing
|
||||
if (same_weightsystem(ws, new_ws)) {
|
||||
if (ws == new_ws) {
|
||||
dives.clear();
|
||||
return;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue