about summary refs log tree commit diff
path: root/src/libstore/remote-store.cc
diff options
context:
space:
mode:
authorGuillaume Maudoux <guillaume.maudoux@uclouvain.be>2019-02-28T23·54+0100
committerGuillaume Maudoux <layus.on@gmail.com>2019-03-09T23·56+0100
commitebc86550f92ec76cda0961ecc625944ec402d2cd (patch)
tree50c7349a7569139b544c4173ac27064b36a0e432 /src/libstore/remote-store.cc
parenta17f86ce3a67dd2dab2329d7262bc4ad4e7c37ff (diff)
Make roots a map of store paths to pinning links
This new structure makes more sense as there may be many sources rooting
the same store path. Many profiles can reference the same path but this
is even more true with /proc/<pid>/maps where distinct pids can and
often do map the same store path.
This implementation is also more efficient as the `Roots` map contains
only one entry per rooted store path.
Diffstat (limited to 'src/libstore/remote-store.cc')
-rw-r--r--src/libstore/remote-store.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/libstore/remote-store.cc b/src/libstore/remote-store.cc
index def140cfbe18..a4dd28af0ea8 100644
--- a/src/libstore/remote-store.cc
+++ b/src/libstore/remote-store.cc
@@ -606,7 +606,7 @@ Roots RemoteStore::findRoots()
     while (count--) {
         Path link = readString(conn->from);
         Path target = readStorePath(*this, conn->from);
-        result[link] = target;
+        result[target].emplace(link);
     }
     return result;
 }