mirror of
https://github.com/NixOS/nix
synced 2025-07-03 22:51:47 +02:00
* Main the `substitutes-rev' table again, but now in a way that
doesn't take \Theta(n^2) space/time complexity.
This commit is contained in:
parent
c25f2883b1
commit
5c443b6550
3 changed files with 40 additions and 21 deletions
|
@ -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();
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue