From 1338e93bc9bcfbd68d1a8a555d45d2ca2fabc30a Mon Sep 17 00:00:00 2001 From: eldritch horrors Date: Sat, 9 Nov 2024 01:17:28 +0100 Subject: [PATCH] libstore: remove curlFileTransfer::enqueueItem return type it's used only once, and the transfer is used for something else afterwards as well. returning it hides that the same transfer is being returned unchanged, and pointlessly extends the signature. Change-Id: Idbd0af00f9aebd3606f6b537b9b7cc9263a45cf7 --- src/libstore/filetransfer.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/libstore/filetransfer.cc b/src/libstore/filetransfer.cc index 352feb720..2fc28e345 100644 --- a/src/libstore/filetransfer.cc +++ b/src/libstore/filetransfer.cc @@ -712,7 +712,7 @@ struct curlFileTransfer : public FileTransfer } } - std::shared_ptr enqueueItem(std::shared_ptr item) + void enqueueItem(std::shared_ptr item) { if (item->uploadData && !item->uri.starts_with("http://") @@ -726,7 +726,6 @@ struct curlFileTransfer : public FileTransfer state->incoming.push(item); } wakeup(); - return item; } #if ENABLE_S3 @@ -857,7 +856,7 @@ struct curlFileTransfer : public FileTransfer auto _state = std::make_shared>(); - auto item = enqueueItem(std::make_shared( + auto item = std::make_shared( *this, uri, headers, @@ -888,7 +887,8 @@ struct curlFileTransfer : public FileTransfer }, std::move(data), noBody - )); + ); + enqueueItem(item); struct TransferSource : Source {