diff options
author | Sérgio Martins <sergio.martins@kdab.com> | 2015-06-27 17:17:33 +0100 |
---|---|---|
committer | Marc Mutz <marc.mutz@kdab.com> | 2015-06-28 21:14:34 +0000 |
commit | aa09cc029fa3a46b0c2004680d3eb20983840456 (patch) | |
tree | 8f0c0aee43d8b6fc31030b14e96e86960c32c01b /src/plugins/platforms/cocoa/qmultitouch_mac.mm | |
parent | 99d9a683b12dbff594e24849e981df78619e0ff1 (diff) |
Fix inefficient container.values().first()
Saves 1 full iteration and 1 memory allocation.
Change-Id: I7e521054bd573f30dea2ec166d566ab6ac60eb4e
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Diffstat (limited to 'src/plugins/platforms/cocoa/qmultitouch_mac.mm')
-rw-r--r-- | src/plugins/platforms/cocoa/qmultitouch_mac.mm | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/plugins/platforms/cocoa/qmultitouch_mac.mm b/src/plugins/platforms/cocoa/qmultitouch_mac.mm index 6e7ebcc37c..13f1cf4612 100644 --- a/src/plugins/platforms/cocoa/qmultitouch_mac.mm +++ b/src/plugins/platforms/cocoa/qmultitouch_mac.mm @@ -190,7 +190,7 @@ QCocoaTouch::getCurrentTouchPointList(NSEvent *event, bool acceptSingleTouch) // touch now (and refake a begin for it later, if needed). if (_updateInternalStateOnly && !wasUpdateInternalStateOnly && !_currentTouches.isEmpty()) { - QCocoaTouch *qcocoaTouch = _currentTouches.values().first(); + QCocoaTouch *qcocoaTouch = _currentTouches.cbegin().value(); qcocoaTouch->_touchPoint.state = Qt::TouchPointReleased; touchPoints.insert(qcocoaTouch->_touchPoint.id, qcocoaTouch->_touchPoint); // Since this last touch also will end up being the first |