From 8b771e782d054d4fd4135491c35d032bc850947a Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Mon, 13 May 2019 20:49:57 +0200 Subject: QNetworkReply: replace a QQueue with a std::vector MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The 'queue' was never used as a queue: it was populated, and then exchanged into a local copy to be consumed in a loop. This loop used dequeue(), but of course it could just const-iterate the container and dump it as the end, since the member variable was already reset at that point, no-one could tell the difference from the outside. So, no need for a queue. A vector will do very nicely. The loop now uses ranged-for and qExchange(), greatly simplifying the code over the old version. Add another qExchange() call as a drive-by. Change-Id: I6147453dc9edfe9500833627b123bb3a31114651 Reviewed-by: MÃ¥rten Nordheim Reviewed-by: Lars Knoll --- src/network/access/qnetworkreplyimpl_p.h | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'src/network/access/qnetworkreplyimpl_p.h') diff --git a/src/network/access/qnetworkreplyimpl_p.h b/src/network/access/qnetworkreplyimpl_p.h index 85f5b862a8..8cec79541a 100644 --- a/src/network/access/qnetworkreplyimpl_p.h +++ b/src/network/access/qnetworkreplyimpl_p.h @@ -117,8 +117,6 @@ public: NotifyCopyFinished }; - typedef QQueue NotificationQueue; - QNetworkReplyImplPrivate(); void _q_startOperation(); @@ -178,7 +176,7 @@ public: bool cacheEnabled; QIODevice *cacheSaveDevice; - NotificationQueue pendingNotifications; + std::vector pendingNotifications; bool notificationHandlingPaused; QUrl urlForLastAuthentication; -- cgit v1.2.3