From 5176b072ed55d1528cb36e0c865e4fcffbc6a7a1 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Tue, 12 Oct 2021 16:43:00 +0200 Subject: [PATCH] Cleanup --- src/libstore/filetransfer.cc | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/src/libstore/filetransfer.cc b/src/libstore/filetransfer.cc index 758862e60..37e17b397 100644 --- a/src/libstore/filetransfer.cc +++ b/src/libstore/filetransfer.cc @@ -725,16 +725,8 @@ ref getFileTransfer() { static ref fileTransfer = makeCurlFileTransfer(); - // this has to be done in its own scope to make sure that the lock is released - // before creating a new fileTransfer instance. - auto needsRecreation = [&]() -> bool { - auto state = fileTransfer->state_.lock(); - return state->quit; - }; - - if (needsRecreation()) { + if (fileTransfer->state_.lock()->quit) fileTransfer = makeCurlFileTransfer(); - } return fileTransfer; }