diff options
author | Eelco Dolstra <edolstra@gmail.com> | 2018-03-20T15·32+0100 |
---|---|---|
committer | Eelco Dolstra <edolstra@gmail.com> | 2018-03-20T15·32+0100 |
commit | 5df427f35b77a87caf280a556b97a35d821499d3 (patch) | |
tree | 9caae655f09a7455ac9305cabe22ad60b7ca20d7 | |
parent | 21ebf6a16028291914bd14b0e5463b020dc7affa (diff) |
Slight simplification
-rw-r--r-- | src/libstore/nar-info-disk-cache.cc | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/src/libstore/nar-info-disk-cache.cc b/src/libstore/nar-info-disk-cache.cc index 6e155e877803..3c52303f0ea4 100644 --- a/src/libstore/nar-info-disk-cache.cc +++ b/src/libstore/nar-info-disk-cache.cc @@ -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; } } |