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>
This commit is contained in:
Tomaz Canabrava 2014-07-15 14:43:20 -03:00 committed by Dirk Hohndel
parent eaacac3217
commit d993684fec
6 changed files with 7 additions and 12 deletions

View file

@ -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());
}