summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDenis Dzyubenko <denis.dzyubenko@nokia.com>2009-04-27 10:05:25 (GMT)
committerDenis Dzyubenko <denis.dzyubenko@nokia.com>2009-05-11 14:51:58 (GMT)
commit66faa6f11f78b5fa4f3da52e74d6ef501bb19ca5 (patch)
treecd26fc53765288f3619c16b26b11a74f847eb06b /src
parentca1add3676fe51f285d16cd0c3bb98ed90e1be65 (diff)
downloadQt-66faa6f11f78b5fa4f3da52e74d6ef501bb19ca5.zip
Qt-66faa6f11f78b5fa4f3da52e74d6ef501bb19ca5.tar.gz
Qt-66faa6f11f78b5fa4f3da52e74d6ef501bb19ca5.tar.bz2
Replaced inefficient foreach with a for loop.
Diffstat (limited to 'src')
-rw-r--r--src/gui/kernel/qgesturemanager.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/gui/kernel/qgesturemanager.cpp b/src/gui/kernel/qgesturemanager.cpp
index 3bdd323..994b2b6 100644
--- a/src/gui/kernel/qgesturemanager.cpp
+++ b/src/gui/kernel/qgesturemanager.cpp
@@ -141,11 +141,15 @@ bool QGestureManager::filterEvent(QEvent *event)
}
activeGestures -= newMaybeGestures;
activeGestures += startedGestures;
- foreach(QGestureRecognizer *r, startedGestures+finishedGestures+notGestures) {
- QMap<QGestureRecognizer*, int>::iterator it = maybeGestures.find(r);
- if (it != maybeGestures.end()) {
+ for(QMap<QGestureRecognizer*, int>::iterator it = maybeGestures.begin();
+ it != maybeGestures.end();) {
+ QGestureRecognizer *r = it.key();
+ if (startedGestures.contains(r) || finishedGestures.contains(r) ||
+ notGestures.contains(r)) {
killTimer(it.value());
- maybeGestures.erase(it);
+ it = maybeGestures.erase(it);
+ } else {
+ ++it;
}
}
foreach(QGestureRecognizer *r, newMaybeGestures) {