aboutsummaryrefslogtreecommitdiff
path: root/src/nix-store/nix-store.cc
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2016-11-10 17:45:04 +0100
committerEelco Dolstra <edolstra@gmail.com>2016-11-10 17:45:04 +0100
commitdd77f7d5931e500585b6539b52ef5a5f3b549a4e (patch)
tree8df85662ed52e49bb0669f5e5c86ef3105163d45 /src/nix-store/nix-store.cc
parent2af5d35fdc1171a9bdab7e2fc005673d76417c06 (diff)
Store::computeFSClosure(): Support a set of paths
This way, callers can exploits the parallelism of computeFSClosure() when they have multiple paths that they need the (combined) closure of.
Diffstat (limited to 'src/nix-store/nix-store.cc')
-rw-r--r--src/nix-store/nix-store.cc12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/nix-store/nix-store.cc b/src/nix-store/nix-store.cc
index a8cb46319..63e20a8c7 100644
--- a/src/nix-store/nix-store.cc
+++ b/src/nix-store/nix-store.cc
@@ -424,10 +424,9 @@ static void opQuery(Strings opFlags, Strings opArgs)
case qRoots: {
PathSet referrers;
for (auto & i : opArgs) {
- PathSet paths = maybeUseOutputs(store->followLinksToStorePath(i), useOutput, forceRealise);
- for (auto & j : paths)
- store->computeFSClosure(j, referrers, true,
- settings.gcKeepOutputs, settings.gcKeepDerivations);
+ store->computeFSClosure(
+ maybeUseOutputs(store->followLinksToStorePath(i), useOutput, forceRealise),
+ referrers, true, settings.gcKeepOutputs, settings.gcKeepDerivations);
}
Roots roots = store->findRoots();
for (auto & i : roots)
@@ -961,10 +960,9 @@ static void opServe(Strings opFlags, Strings opArgs)
case cmdQueryClosure: {
bool includeOutputs = readInt(in);
- PathSet paths = readStorePaths<PathSet>(*store, in);
PathSet closure;
- for (auto & i : paths)
- store->computeFSClosure(i, closure, false, includeOutputs);
+ store->computeFSClosure(readStorePaths<PathSet>(*store, in),
+ closure, false, includeOutputs);
out << closure;
break;
}