]> dgit.raspbian.org Git - nextcloud-desktop.git/commitdiff
Use modern for loop in BandwidthManager::relativeDownloadDelayTimerExpired
authorClaudio Cambra <claudio.cambra@nextcloud.com>
Mon, 15 May 2023 12:04:19 +0000 (20:04 +0800)
committerClaudio Cambra <claudio.cambra@nextcloud.com>
Mon, 15 May 2023 12:46:21 +0000 (20:46 +0800)
getFileJobSigned-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>

src/libsync/bandwidthmanager.cpp

index d7a4ebd9fae1fb2868046587b98cc265557f5bc6..a313fe5e0c2f9d8d5d2d9f9fd59734b823bd79f9 100644 (file)
@@ -327,11 +327,13 @@ void BandwidthManager::relativeDownloadDelayTimerExpired()
     _relativeLimitCurrentMeasuredJob->setChoked(false);
 
     // choke all other download jobs
-    Q_FOREACH (GETFileJob *gfj, _downloadJobList) {
-        if (gfj != _relativeLimitCurrentMeasuredJob) {
-            gfj->setBandwidthLimited(true);
-            gfj->setChoked(true);
+    for (const auto getFileJob : _downloadJobList) {
+        if (getFileJob == _relativeLimitCurrentMeasuredJob) {
+            continue;
         }
+
+        getFileJob->setBandwidthLimited(true);
+        getFileJob->setChoked(true);
     }
 
     // now we're in measuring state