diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2014-05-20 06:37:19 +0900 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2014-05-20 06:37:19 +0900 |
commit | 09e7c61feeeabac3dd983c11aca49b23155fff80 (patch) | |
tree | f82b271b89dd0f2f85cc78a1c0724df29204f439 /qt-ui/divelistview.cpp | |
parent | b303f217a9d66ef031c58534b3796ddefbe362c5 (diff) | |
download | subsurface-09e7c61feeeabac3dd983c11aca49b23155fff80.tar.gz |
Consistently use for_each_dive (and use it correctly)
The way the macro is written there is no need to test the dive against
NULL before dereferencing.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui/divelistview.cpp')
-rw-r--r-- | qt-ui/divelistview.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/qt-ui/divelistview.cpp b/qt-ui/divelistview.cpp index e6d82d5bc..c1d6e8d4d 100644 --- a/qt-ui/divelistview.cpp +++ b/qt-ui/divelistview.cpp @@ -706,8 +706,7 @@ void DiveListView::deleteDive() // so instead of using the for_each_dive macro I'm using an explicit for loop // to make this easier to understand int lastDiveNr = -1; - for (i = 0; i < dive_table.nr; i++) { - d = get_dive(i); + for_each_dive (i, d) { if (!d->selected) continue; delete_single_dive(i); |