From: Matthieu Gallien Date: Thu, 25 Nov 2021 15:44:57 +0000 (+0100) Subject: use a proper constant for the size of batch X-Git-Tag: archive/raspbian/3.16.7-1_deb13u1+rpi1~1^2~12^2~18^2~83^2~6 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=59953d857b1613ea8d807a73ff03bdcdc0ba8b7b;p=nextcloud-desktop.git use a proper constant for the size of batch Signed-off-by: Matthieu Gallien --- diff --git a/src/libsync/bulkpropagatorjob.cpp b/src/libsync/bulkpropagatorjob.cpp index 3aa8b76a2..7c74a3ce9 100644 --- a/src/libsync/bulkpropagatorjob.cpp +++ b/src/libsync/bulkpropagatorjob.cpp @@ -64,6 +64,8 @@ QByteArray getHeaderFromJsonReply(const QJsonObject &reply, const QByteArray &he return reply.value(headerName).toString().toLatin1(); } +constexpr auto batchSize = 100; + } namespace OCC { @@ -73,7 +75,8 @@ BulkPropagatorJob::BulkPropagatorJob(OwncloudPropagator *propagator, : PropagatorJob(propagator) , _items(items) { - _filesToUpload.reserve(100); + _filesToUpload.reserve(batchSize); + _pendingChecksumFiles.reserve(batchSize); } bool BulkPropagatorJob::scheduleSelfOrChild() @@ -83,7 +86,7 @@ bool BulkPropagatorJob::scheduleSelfOrChild() } _state = Running; - for(int i = 0; i < 100 && !_items.empty(); ++i) { + for(int i = 0; i < batchSize && !_items.empty(); ++i) { auto currentItem = _items.front(); _items.pop_front(); _pendingChecksumFiles.insert(currentItem->_file);