about summary refs log tree commit diff
path: root/src/libstore/misc.cc
diff options
context:
space:
mode:
authorEelco Dolstra <e.dolstra@tudelft.nl>2009-04-21T11·52+0000
committerEelco Dolstra <e.dolstra@tudelft.nl>2009-04-21T11·52+0000
commitd5eab2fc8293e0d14c7fd297bf7512257442295b (patch)
treeaa987c9496ee667ff59eccab1681b49b363a44cd /src/libstore/misc.cc
parent8f1bf28505e6ba8fae35859391cbab7264b0014a (diff)
* Use foreach in a lot of places.
Diffstat (limited to 'src/libstore/misc.cc')
-rw-r--r--src/libstore/misc.cc15
1 files changed, 5 insertions, 10 deletions
diff --git a/src/libstore/misc.cc b/src/libstore/misc.cc
index 85197adcf0db..f2b4c7a4ee60 100644
--- a/src/libstore/misc.cc
+++ b/src/libstore/misc.cc
@@ -30,16 +30,14 @@ void computeFSClosure(const Path & storePath,
     else
         store->queryReferences(storePath, references);
 
-    for (PathSet::iterator i = references.begin();
-         i != references.end(); ++i)
+    foreach (PathSet::iterator, i, references)
         computeFSClosure(*i, paths, flipDirection);
 }
 
 
 Path findOutput(const Derivation & drv, string id)
 {
-    for (DerivationOutputs::const_iterator i = drv.outputs.begin();
-         i != drv.outputs.end(); ++i)
+    foreach (DerivationOutputs::const_iterator, i, drv.outputs)
         if (i->first == id) return i->second.path;
     throw Error(format("derivation has no output `%1%'") % id);
 }
@@ -67,20 +65,17 @@ void queryMissing(const PathSet & targets,
             Derivation drv = derivationFromPath(p);
 
             bool mustBuild = false;
-            for (DerivationOutputs::iterator i = drv.outputs.begin();
-                 i != drv.outputs.end(); ++i)
+            foreach (DerivationOutputs::iterator, i, drv.outputs)
                 if (!store->isValidPath(i->second.path) && !store->hasSubstitutes(i->second.path))
                     mustBuild = true;
 
             if (mustBuild) {
                 willBuild.insert(p);
                 todo.insert(drv.inputSrcs.begin(), drv.inputSrcs.end());
-                for (DerivationInputs::iterator i = drv.inputDrvs.begin();
-                     i != drv.inputDrvs.end(); ++i)
+                foreach (DerivationInputs::iterator, i, drv.inputDrvs)
                     todo.insert(i->first);
             } else 
-                for (DerivationOutputs::iterator i = drv.outputs.begin();
-                     i != drv.outputs.end(); ++i)
+                foreach (DerivationOutputs::iterator, i, drv.outputs)
                     todo.insert(i->second.path);
         }