1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-27 16:51:15 +02:00

* Made addToStore() a lot more efficient: it no longer reads the path

being copied 3 times in the worst case.  It doesn't run in constant space,
  but it didn't do that anyway.
This commit is contained in:
Eelco Dolstra 2008-12-03 15:51:17 +00:00
parent 64519cfd65
commit 1307b22223
2 changed files with 29 additions and 35 deletions

View file

@ -257,9 +257,7 @@ static Hash hashDerivationModulo(EvalState & state, Derivation drv)
/* For other derivations, replace the inputs paths with recursive
calls to this function.*/
DerivationInputs inputs2;
for (DerivationInputs::iterator i = drv.inputDrvs.begin();
i != drv.inputDrvs.end(); ++i)
{
foreach (DerivationInputs::const_iterator, i, drv.inputDrvs) {
Hash h = state.drvHashes[i->first];
if (h.type == htUnknown) {
Derivation drv2 = derivationFromPath(i->first);