diff options
author | Ahmad Samir <a.samirh78@gmail.com> | 2023-08-11 20:11:56 +0300 |
---|---|---|
committer | Ahmad Samir <a.samirh78@gmail.com> | 2023-08-22 21:50:28 +0300 |
commit | d489d207c4304ecab1bb7577f8cb21edeca5fd4e (patch) | |
tree | d0136fca4168503113fbe8c21bc4cfd5cdb36a27 /tests/auto | |
parent | 659b6d559533cda60d5f4d4f2f7c7b837226c6c8 (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')
-rw-r--r-- | tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp | 2 |
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; } |