diff options
author | Eelco Dolstra <e.dolstra@tudelft.nl> | 2004-08-31 16:13:10 +0000 |
---|---|---|
committer | Eelco Dolstra <e.dolstra@tudelft.nl> | 2004-08-31 16:13:10 +0000 |
commit | 5c443b65501903f636b00b908bb8eb10e022402e (patch) | |
tree | 6eda7c08e475b9a4024e167b18531726d3177299 /src/nix-store | |
parent | c25f2883b149bf71931f963d29241fe012360633 (diff) |
* Main the `substitutes-rev' table again, but now in a way that
doesn't take \Theta(n^2) space/time complexity.
Diffstat (limited to 'src/nix-store')
-rw-r--r-- | src/nix-store/main.cc | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/nix-store/main.cc b/src/nix-store/main.cc index e9948c7cf..a8acd30c7 100644 --- a/src/nix-store/main.cc +++ b/src/nix-store/main.cc @@ -158,6 +158,7 @@ static void opSubstitute(Strings opFlags, Strings opArgs) if (!opArgs.empty()) throw UsageError("no arguments expected"); + SubstitutePairs subPairs; Transaction txn; createStoreTransaction(txn); @@ -179,9 +180,11 @@ static void opSubstitute(Strings opFlags, Strings opArgs) sub.args.push_back(s); } if (!cin || cin.eof()) throw Error("missing input"); - registerSubstitute(txn, srcPath, sub); + subPairs.push_back(pair<Path, Substitute>(srcPath, sub)); } + registerSubstitutes(txn, subPairs); + txn.commit(); } |