getDownloader(): Simplify

This commit is contained in:
Eelco Dolstra 2018-03-28 13:16:27 +02:00
parent e87e4a60d6
commit 5a654fd7dd
No known key found for this signature in database
GPG key ID: 8170B4726D7198DE

View file

@ -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()