profile: remove redundant timestamp lookup for DiveEventItems

When placing the event icons, the timestamp is looked up and
then, the depth is checked which repeats this operation.
Remove the first instance of this lookup, as it is completely
redundant.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2021-08-31 20:19:01 +02:00 committed by Dirk Hohndel
parent 8a9ca5fcda
commit 8d4d35ea69

View file

@ -229,12 +229,6 @@ void DiveEventItem::recalculatePos(int speed)
if (!ev)
return;
QModelIndexList result = dataModel->match(dataModel->index(0, DivePlotDataModel::TIME), Qt::DisplayRole, ev->time.seconds);
if (result.isEmpty()) {
qWarning("can't find a spot in the dataModel");
hide();
return;
}
int depth = depthAtTime(*dataModel, ev->time.seconds);
if (depth == DEPTH_NOT_FOUND) {
hide();