From d993684fec07ccf6c3135e16286cd87e045f142c Mon Sep 17 00:00:00 2001 From: Tomaz Canabrava Date: Tue, 15 Jul 2014 14:43:20 -0300 Subject: Do not create a backup for Q_FOREACH container Q_FOREACH will expand and already creates a copy of the contained container, so this is just a waste of cpu cycles and also increases a tiny bit the memory consumption. Signed-off-by: Tomaz Canabrava Signed-off-by: Dirk Hohndel --- qt-ui/profile/divetooltipitem.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'qt-ui/profile/divetooltipitem.cpp') diff --git a/qt-ui/profile/divetooltipitem.cpp b/qt-ui/profile/divetooltipitem.cpp index 032daf6ee..40c556cc6 100644 --- a/qt-ui/profile/divetooltipitem.cpp +++ b/qt-ui/profile/divetooltipitem.cpp @@ -229,8 +229,8 @@ void ToolTipItem::refresh(const QPointF &pos) addToolTip(QString::fromUtf8(mb.buffer, mb.len)); free_buffer(&mb); - QList items = scene()->items(pos, Qt::IntersectsItemShape, Qt::DescendingOrder, scene()->views().first()->transform()); - Q_FOREACH (QGraphicsItem *item, items) { + Q_FOREACH (QGraphicsItem *item, scene()->items(pos, Qt::IntersectsItemShape + ,Qt::DescendingOrder, scene()->views().first()->transform())) { if (!item->toolTip().isEmpty()) addToolTip(item->toolTip()); } -- cgit v1.2.3-70-g09d2