QFlickGestureRecognizer: remove a useless check

There's no point in checking isEmpty() to prevent a for loop from
executing, esp. if the checking involves copying the container
and calling an out-of-line function to get said copy.

Just fall through the for loop.

Change-Id: If6c689ff4bcd685bc645b4fb3f2c15ce5d5945af
Reviewed-by: Sérgio Martins <iamsergio@gmail.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
This commit is contained in:
Marc Mutz 2015-12-16 01:43:17 +01:00
parent 13e499893c
commit 404b1fd8b3

View File

@ -583,7 +583,7 @@ QGestureRecognizer::Result QFlickGestureRecognizer::recognize(QGesture *state,
scrollerRegion = QRect(w->mapToGlobal(QPoint(0, 0)), w->size());
#ifndef QT_NO_GRAPHICSVIEW
} else if (QGraphicsObject *go = qobject_cast<QGraphicsObject *>(as->target())) {
if (go->scene() && !go->scene()->views().isEmpty()) {
if (go->scene()) {
foreach (QGraphicsView *gv, go->scene()->views())
scrollerRegion |= gv->mapFromScene(go->mapToScene(go->boundingRect()))
.translated(gv->mapToGlobal(QPoint(0, 0)));