QHttpNetworkConnection: fix expensive iteration over QMultiMap::values()

Just iterate over the container instead, saving one
iteration and the creation of a temporary QList.

Change-Id: I564e3e83cb247a12c413fc5a9dc17299ae089e30
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
This commit is contained in:
Marc Mutz 2016-03-04 11:09:18 +01:00
parent 5a56bf4104
commit fd941ebb6f

View File

@ -1180,10 +1180,9 @@ void QHttpNetworkConnectionPrivate::_q_hostLookupFinished(const QHostInfo &info)
}
#ifndef QT_NO_SSL
else if (connectionType == QHttpNetworkConnection::ConnectionTypeSPDY) {
QList<HttpMessagePair> spdyPairs = channels[0].spdyRequestsToSend.values();
for (int a = 0; a < spdyPairs.count(); ++a) {
for (const HttpMessagePair &spdyPair : qAsConst(channels[0].spdyRequestsToSend)) {
// emit error for all replies
QHttpNetworkReply *currentReply = spdyPairs.at(a).second;
QHttpNetworkReply *currentReply = spdyPair.second;
Q_ASSERT(currentReply);
emitReplyError(channels[0].socket, currentReply, QNetworkReply::HostNotFoundError);
}