From 1307b222239da8e503d22ad9316789e30b4e2431 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Wed, 3 Dec 2008 15:51:17 +0000 Subject: * 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. --- src/libexpr/primops.cc | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'src/libexpr/primops.cc') diff --git a/src/libexpr/primops.cc b/src/libexpr/primops.cc index 27ce28b8f73d..657c3bf71ba7 100644 --- a/src/libexpr/primops.cc +++ b/src/libexpr/primops.cc @@ -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); -- cgit 1.4.1