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>
This commit is contained in:
parent
99d9a683b1
commit
aa09cc029f
@ -1443,7 +1443,7 @@ void QHttpNetworkConnectionPrivate::emitProxyAuthenticationRequired(const QHttpN
|
||||
// but that does not matter because the signal will ultimately be emitted
|
||||
// by the QNetworkAccessManager.
|
||||
Q_ASSERT(chan->spdyRequestsToSend.count() > 0);
|
||||
reply = chan->spdyRequestsToSend.values().first().second;
|
||||
reply = chan->spdyRequestsToSend.cbegin().value().second;
|
||||
} else { // HTTP
|
||||
#endif // QT_NO_SSL
|
||||
reply = chan->reply;
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user