cleanup: Improper use of negative value

CID 45112

Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
This commit is contained in:
Jan Mulder 2017-12-28 19:20:04 +01:00 committed by Dirk Hohndel
parent 2fb5a7d082
commit 686544bcef

View file

@ -62,7 +62,9 @@ void UndoDeleteDive::redo()
tripList.append(undo_trip);
}
//delete the dive
delete_single_dive(get_divenr(diveList.at(i)));
int nr;
if ((nr = get_divenr(diveList.at(i))) >= 0)
delete_single_dive(nr);
}
mark_divelist_changed(true);
MainWindow::instance()->refreshDisplay();