From: Claudio Cambra Date: Thu, 11 May 2023 11:57:28 +0000 (+0800) Subject: Clean up and const autofy BulkPropagatorJob::scheduleSelfOrChild X-Git-Tag: archive/raspbian/3.16.7-1_deb13u1+rpi1~1^2~12^2~10^2~51^2~13 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=4375a24f0f6db60ad81c6e12fabb518606d3614b;p=nextcloud-desktop.git Clean up and const autofy BulkPropagatorJob::scheduleSelfOrChild Signed-off-by: Claudio Cambra --- diff --git a/src/libsync/bulkpropagatorjob.cpp b/src/libsync/bulkpropagatorjob.cpp index bbbc98ab1..f34fd8593 100644 --- a/src/libsync/bulkpropagatorjob.cpp +++ b/src/libsync/bulkpropagatorjob.cpp @@ -82,19 +82,18 @@ BulkPropagatorJob::BulkPropagatorJob(OwncloudPropagator *propagator, bool BulkPropagatorJob::scheduleSelfOrChild() { - if (_items.empty()) { - return false; - } - if (!_pendingChecksumFiles.empty()) { + if (_items.empty() || !_pendingChecksumFiles.empty()) { return false; } _state = Running; - for(int i = 0; i < batchSize && !_items.empty(); ++i) { - auto currentItem = _items.front(); + + for(auto i = 0; i < batchSize && !_items.empty(); ++i) { + const auto currentItem = _items.front(); _items.pop_front(); _pendingChecksumFiles.insert(currentItem->_file); - QMetaObject::invokeMethod(this, [this, currentItem] () { + + QMetaObject::invokeMethod(this, [this, currentItem] { UploadFileInfo fileToUpload; fileToUpload._file = currentItem->_file; fileToUpload._size = currentItem->_size;