From d489d207c4304ecab1bb7577f8cb21edeca5fd4e Mon Sep 17 00:00:00 2001 From: Ahmad Samir Date: Fri, 11 Aug 2023 20:11:56 +0300 Subject: [PATCH] tst_QNetworkReply: port Q_FOREACH to ranged-for MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The QHash "cache" isn't modified in the loop body (method is const), in general cacheSize() shouldn't be susceptible to data races. Task-number: QTBUG-115839 Change-Id: I122a03ddd5e648d16736c16fa9289eafc886979d Reviewed-by: MÃ¥rten Nordheim --- tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp b/tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp index 4d34cb3721..cad531e7e9 100644 --- a/tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp +++ b/tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp @@ -850,7 +850,7 @@ public: qint64 cacheSize() const override { qint64 total = 0; - foreach (const CachedContent &entry, cache) + for (const auto &[_, entry] : cache.asKeyValueRange()) total += entry.second.size(); return total; }