Remove pointless code

When removing the selected dives from their trips, it makes no sense to
check if the pointer was actually pointing at a valid dive.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2013-12-08 06:05:54 +01:00
parent 4dc3061aa5
commit ad6fab9fb0

View file

@ -543,9 +543,7 @@ void DiveListView::mergeTripBelow()
void DiveListView::removeFromTrip() void DiveListView::removeFromTrip()
{ {
int i; int i;
struct dive *d = (struct dive *) contextMenuIndex.data(DiveTripModel::DIVE_ROLE).value<void*>(); struct dive *d;
if (!d) // shouldn't happen as we only are setting up this action if this is a dive
return;
for_each_dive(i, d) { for_each_dive(i, d) {
if (d->selected) if (d->selected)
remove_dive_from_trip(d); remove_dive_from_trip(d);