Adapt code style in addition to #2300
authorMichael Schuster <michael@schuster.ms>
Wed, 26 Aug 2020 23:31:06 +0000 (01:31 +0200)
committerMichael Schuster <michael@schuster.ms>
Wed, 26 Aug 2020 23:31:06 +0000 (01:31 +0200)
- Use "!empty()" instead of "size() > 0" in std::list
- Add comments for namespace brackets

Signed-off-by: Michael Schuster <michael@schuster.ms>
src/libsync/bandwidthmanager.cpp
src/libsync/bandwidthmanager.h

index cd643ced8fb2003645c3528b9cc890102afbf803..79b19057f0eee3dcccd12713e60c9fef41a5b98e 100644 (file)
@@ -383,7 +383,7 @@ void BandwidthManager::absoluteLimitTimerExpired()
             qCDebug(lcBandwidthManager) << "Gave " << quotaPerDevice / 1024.0 << " kB to" << device;
         }
     }
-    if (usingAbsoluteDownloadLimit() && _downloadJobList.size() > 0) {
+    if (usingAbsoluteDownloadLimit() && !_downloadJobList.empty()) {
         qint64 quotaPerJob = _currentDownloadLimit / qMax((std::list<GETFileJob *>::size_type)1, _downloadJobList.size());
         qCDebug(lcBandwidthManager) << quotaPerJob << _downloadJobList.size() << _currentDownloadLimit;
         Q_FOREACH (GETFileJob *j, _downloadJobList) {
@@ -392,4 +392,5 @@ void BandwidthManager::absoluteLimitTimerExpired()
         }
     }
 }
-}
+
+} // namespace OCC
index 15d949fbcb159fb1ddb4d79aa031f07673927e51..43b4a36b94919c4566396641869d29dca9aaf1ed 100644 (file)
@@ -100,6 +100,7 @@ private:
 
     qint64 _currentDownloadLimit;
 };
-}
+
+} // namespace OCC
 
 #endif