From dd77f7d5931e500585b6539b52ef5a5f3b549a4e Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Thu, 10 Nov 2016 17:45:04 +0100 Subject: 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. --- src/nix-store/nix-store.cc | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'src/nix-store/nix-store.cc') diff --git a/src/nix-store/nix-store.cc b/src/nix-store/nix-store.cc index a8cb46319abc..63e20a8c77a7 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(*store, in); PathSet closure; - for (auto & i : paths) - store->computeFSClosure(i, closure, false, includeOutputs); + store->computeFSClosure(readStorePaths(*store, in), + closure, false, includeOutputs); out << closure; break; } -- cgit 1.4.1