summary refs log tree commit diff
path: root/src/libexpr
diff options
context:
space:
mode:
authorEelco Dolstra <e.dolstra@tudelft.nl>2008-12-03 15:51:17 +0000
committerEelco Dolstra <e.dolstra@tudelft.nl>2008-12-03 15:51:17 +0000
commit1307b222239da8e503d22ad9316789e30b4e2431 (patch)
treeb2b84893aadf91122672e79244072c529239e39d /src/libexpr
parent64519cfd657d024ae6e2bb74cb21ad21b886fd2a (diff)
downloadguix-1307b222239da8e503d22ad9316789e30b4e2431.tar.gz
* 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.

Diffstat (limited to 'src/libexpr')
-rw-r--r--src/libexpr/primops.cc4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/libexpr/primops.cc b/src/libexpr/primops.cc
index 27ce28b8f7..657c3bf71b 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);