about summary refs log tree commit diff
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2018-03-28T11·16+0200
committerEelco Dolstra <edolstra@gmail.com>2018-05-30T11·42+0200
commit5a654fd7dd0bf58470e0a15d451cf36ce0c62beb (patch)
tree3751cf2a9ed4fbf15be276e95ea47526f8928bd5
parente87e4a60d617bffadfedf23032254130cdb4d54d (diff)
getDownloader(): Simplify
-rw-r--r--src/libstore/download.cc6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/libstore/download.cc b/src/libstore/download.cc
index d450714ca50f..72a08ef0089c 100644
--- a/src/libstore/download.cc
+++ b/src/libstore/download.cc
@@ -609,10 +609,8 @@ struct CurlDownloader : public Downloader
 
 ref<Downloader> getDownloader()
 {
-    static std::shared_ptr<Downloader> downloader;
-    static std::once_flag downloaderCreated;
-    std::call_once(downloaderCreated, [&]() { downloader = makeDownloader(); });
-    return ref<Downloader>(downloader);
+    static ref<Downloader> downloader = makeDownloader();
+    return downloader;
 }
 
 ref<Downloader> makeDownloader()