Slight simplification

This commit is contained in:
Eelco Dolstra 2018-03-20 16:32:59 +01:00
parent 21ebf6a160
commit 5df427f35b
No known key found for this signature in database
GPG key ID: 8170B4726D7198DE

View file

@ -260,11 +260,8 @@ public:
ref<NarInfoDiskCache> getNarInfoDiskCache()
{
static Sync<std::shared_ptr<NarInfoDiskCache>> cache;
auto cache_(cache.lock());
if (!*cache_) *cache_ = std::make_shared<NarInfoDiskCacheImpl>();
return ref<NarInfoDiskCache>(*cache_);
static ref<NarInfoDiskCache> cache = make_ref<NarInfoDiskCacheImpl>();
return cache;
}
}