Slight simplification
This commit is contained in:
parent
21ebf6a160
commit
5df427f35b
1 changed files with 2 additions and 5 deletions
|
@ -260,11 +260,8 @@ public:
|
||||||
|
|
||||||
ref<NarInfoDiskCache> getNarInfoDiskCache()
|
ref<NarInfoDiskCache> getNarInfoDiskCache()
|
||||||
{
|
{
|
||||||
static Sync<std::shared_ptr<NarInfoDiskCache>> cache;
|
static ref<NarInfoDiskCache> cache = make_ref<NarInfoDiskCacheImpl>();
|
||||||
|
return cache;
|
||||||
auto cache_(cache.lock());
|
|
||||||
if (!*cache_) *cache_ = std::make_shared<NarInfoDiskCacheImpl>();
|
|
||||||
return ref<NarInfoDiskCache>(*cache_);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue