diff options
author | Marc Mutz <marc.mutz@kdab.com> | 2015-12-16 01:43:17 +0100 |
---|---|---|
committer | Marc Mutz <marc.mutz@kdab.com> | 2015-12-17 16:47:48 +0000 |
commit | 404b1fd8b351c5e23a283a21a621e35cdd24a6e4 (patch) | |
tree | 6ae6225fa69bac4fcb654f461107593b51f709ed /src/widgets | |
parent | 13e499893c0231953b647c0ac8718443a3c92098 (diff) |
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>
Diffstat (limited to 'src/widgets')
-rw-r--r-- | src/widgets/util/qflickgesture.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/widgets/util/qflickgesture.cpp b/src/widgets/util/qflickgesture.cpp index 6d23977dc0..b240902ced 100644 --- a/src/widgets/util/qflickgesture.cpp +++ b/src/widgets/util/qflickgesture.cpp @@ -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))); |