diff options
author | Marc Mutz <marc.mutz@kdab.com> | 2015-12-21 14:00:24 +0100 |
---|---|---|
committer | Marc Mutz <marc.mutz@kdab.com> | 2015-12-22 13:42:28 +0000 |
commit | f68260e6c078ec239a1b451c2a6d963340d3ce7e (patch) | |
tree | 57b3cf6401c8988e22272f2176c37609d5644f23 /src/platformsupport/devicediscovery/qdevicediscovery_static.cpp | |
parent | f074c57caea19e623571c21d87a22acf9556f1fc (diff) |
Optimize a code path in QGraphicsScenePrivate::cancelGesturesForChildren()
If ev.isAccepted(), since list is gestures.toList(), the
first foreach loop would clear 'gestures', one item at
a time. The second foreach loop would then not execute
at all.
Make this case clearer by not executing either loop if
ev.isAccepted().
Make it more performant by not iterating twice, but once,
simply skipping those gestures in the second (remaining)
loop which would have been removed by the first one.
Also iterate over the equivalent QList instead of the QSet,
because the former is way more efficient.
Text size savings are present, but minimal. The runtime
savings are signficant, of course.
Change-Id: I3d5bfe99c5d3fcbe4c98816577846551c632f315
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Diffstat (limited to 'src/platformsupport/devicediscovery/qdevicediscovery_static.cpp')
0 files changed, 0 insertions, 0 deletions