diff options
author | Berthold Stoeger <bstoeger@mail.tuwien.ac.at> | 2019-11-03 23:08:32 +0100 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2019-12-05 10:14:25 -0800 |
commit | dc67876c7955b21f969545eee6f3ae3bdb550787 (patch) | |
tree | ea9fd130fa10807410a7376799f03f46a2fbc64b /commands/command_edit.cpp | |
parent | 92b833a7d85f7d361f2b198782bb093c300ed59a (diff) | |
download | subsurface-dc67876c7955b21f969545eee6f3ae3bdb550787.tar.gz |
Cleanup: introduce empty_weightsystem constant
To make things more future-proof, introduce an empty_weightsystem
constant. Replace explicit aggragate initialization of empty
weightsystems by this constant.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'commands/command_edit.cpp')
-rw-r--r-- | commands/command_edit.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/commands/command_edit.cpp b/commands/command_edit.cpp index bfa02a55d..d0d9fc087 100644 --- a/commands/command_edit.cpp +++ b/commands/command_edit.cpp @@ -978,9 +978,8 @@ void AddWeight::undo() void AddWeight::redo() { - weightsystem_t ws { {0}, "" }; for (dive *d: dives) { - add_cloned_weightsystem(&d->weightsystems, ws); + add_cloned_weightsystem(&d->weightsystems, empty_weightsystem); emit diveListNotifier.weightAdded(d, d->weightsystems.nr - 1); } } @@ -996,7 +995,7 @@ static int find_weightsystem_index(const struct dive *d, weightsystem_t ws) RemoveWeight::RemoveWeight(int index, bool currentDiveOnly) : EditDivesBase(currentDiveOnly), - ws{ {0}, nullptr } + ws(empty_weightsystem) { // Get the old weightsystem, bail if index is invalid if (!current || index < 0 || index >= current->weightsystems.nr) { |