From 8d4d35ea692d95d8d14e8eef3f4f3f68dab5cba4 Mon Sep 17 00:00:00 2001 From: Berthold Stoeger Date: Tue, 31 Aug 2021 20:19:01 +0200 Subject: [PATCH] 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 --- profile-widget/diveeventitem.cpp | 6 ------ 1 file changed, 6 deletions(-) diff --git a/profile-widget/diveeventitem.cpp b/profile-widget/diveeventitem.cpp index 2488284fb..f149417c9 100644 --- a/profile-widget/diveeventitem.cpp +++ b/profile-widget/diveeventitem.cpp @@ -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();