about summary refs log tree commit diff
path: root/src/libstore
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2018-03-20T15·32+0100
committerEelco Dolstra <edolstra@gmail.com>2018-03-20T15·32+0100
commit5df427f35b77a87caf280a556b97a35d821499d3 (patch)
tree9caae655f09a7455ac9305cabe22ad60b7ca20d7 /src/libstore
parent21ebf6a16028291914bd14b0e5463b020dc7affa (diff)
Slight simplification
Diffstat (limited to 'src/libstore')
-rw-r--r--src/libstore/nar-info-disk-cache.cc7
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;
 }
 
 }