From 5a654fd7dd0bf58470e0a15d451cf36ce0c62beb Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Wed, 28 Mar 2018 13:16:27 +0200 Subject: [PATCH] getDownloader(): Simplify --- src/libstore/download.cc | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/libstore/download.cc b/src/libstore/download.cc index d450714ca..72a08ef00 100644 --- a/src/libstore/download.cc +++ b/src/libstore/download.cc @@ -609,10 +609,8 @@ struct CurlDownloader : public Downloader ref getDownloader() { - static std::shared_ptr downloader; - static std::once_flag downloaderCreated; - std::call_once(downloaderCreated, [&]() { downloader = makeDownloader(); }); - return ref(downloader); + static ref downloader = makeDownloader(); + return downloader; } ref makeDownloader()