summaryrefslogtreecommitdiffstats
path: root/qt-ui/profile/divetooltipitem.cpp
diff options
context:
space:
mode:
authorGravatar Tomaz Canabrava <tomaz.canabrava@intel.com>2014-07-15 14:43:20 -0300
committerGravatar Dirk Hohndel <dirk@hohndel.org>2014-07-15 16:55:10 -0700
commitd993684fec07ccf6c3135e16286cd87e045f142c (patch)
tree03f59a88719625ca03cd8fccba3f17ddbc85c569 /qt-ui/profile/divetooltipitem.cpp
parenteaacac321743434ce8610b4b61f56a3fe4a63567 (diff)
downloadsubsurface-d993684fec07ccf6c3135e16286cd87e045f142c.tar.gz
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 <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui/profile/divetooltipitem.cpp')
-rw-r--r--qt-ui/profile/divetooltipitem.cpp4
1 files changed, 2 insertions, 2 deletions
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<QGraphicsItem *> 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());
}