summaryrefslogtreecommitdiffstats
path: root/tests/auto/network/access/qnetworkreply
diff options
context:
space:
mode:
authorAhmad Samir <a.samirh78@gmail.com>2023-08-11 20:11:56 +0300
committerAhmad Samir <a.samirh78@gmail.com>2023-08-22 21:50:28 +0300
commitd489d207c4304ecab1bb7577f8cb21edeca5fd4e (patch)
treed0136fca4168503113fbe8c21bc4cfd5cdb36a27 /tests/auto/network/access/qnetworkreply
parent659b6d559533cda60d5f4d4f2f7c7b837226c6c8 (diff)
tst_QNetworkReply: port Q_FOREACH to ranged-for
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 <marten.nordheim@qt.io>
Diffstat (limited to 'tests/auto/network/access/qnetworkreply')
-rw-r--r--tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp2
1 files changed, 1 insertions, 1 deletions
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;
}