File tree Expand file tree Collapse file tree 2 files changed +12
-0
lines changed
Expand file tree Collapse file tree 2 files changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -354,8 +354,10 @@ int BlockCompressor::compress(uint64& outputSize)
354354 }
355355 else {
356356 vector<FileCompressTask<FileCompressResult>*> tasks;
357+ #ifdef CONCURRENCY_ENABLED
357358 vector<int > jobsPerTask (nbFiles);
358359 Global::computeJobsPerTask (jobsPerTask.data (), _jobs, nbFiles);
360+ #endif
359361
360362 if (_reorderFiles == true )
361363 sortFilesByPathAndSize (files, true );
@@ -383,7 +385,11 @@ int BlockCompressor::compress(uint64& outputSize)
383385 taskCtx.putString (" inputName" , iName);
384386 taskCtx.putString (" outputName" , oName);
385387 taskCtx.putInt (" blockSize" , _blockSize);
388+ #ifdef CONCURRENCY_ENABLED
386389 taskCtx.putInt (" jobs" , jobsPerTask[i]);
390+ #else
391+ taskCtx.putInt (" jobs" , 1 );
392+ #endif
387393 FileCompressTask<FileCompressResult>* task = new FileCompressTask<FileCompressResult>(taskCtx, _listeners);
388394 tasks.push_back (task);
389395 }
Original file line number Diff line number Diff line change @@ -248,8 +248,10 @@ int BlockDecompressor::decompress(uint64& inputSize)
248248 }
249249 else {
250250 vector<FileDecompressTask<FileDecompressResult>*> tasks;
251+ #ifdef CONCURRENCY_ENABLED
251252 vector<int > jobsPerTask (nbFiles);
252253 Global::computeJobsPerTask (jobsPerTask.data (), _jobs, nbFiles);
254+ #endif
253255 sortFilesByPathAndSize (files, true );
254256
255257 // Create one task per file
@@ -280,7 +282,11 @@ int BlockDecompressor::decompress(uint64& inputSize)
280282 taskCtx.putLong (" fileSize" , files[i]._size );
281283 taskCtx.putString (" inputName" , iName);
282284 taskCtx.putString (" outputName" , oName);
285+ #ifdef CONCURRENCY_ENABLED
283286 taskCtx.putInt (" jobs" , jobsPerTask[i]);
287+ #else
288+ taskCtx.putInt (" jobs" , 1 );
289+ #endif
284290 FileDecompressTask<FileDecompressResult>* task = new FileDecompressTask<FileDecompressResult>(taskCtx, _listeners);
285291 tasks.push_back (task);
286292 }
You can’t perform that action at this time.
0 commit comments