diff options
author | Eelco Dolstra <e.dolstra@tudelft.nl> | 2009-04-21 11:52:16 +0000 |
---|---|---|
committer | Eelco Dolstra <e.dolstra@tudelft.nl> | 2009-04-21 11:52:16 +0000 |
commit | d5eab2fc8293e0d14c7fd297bf7512257442295b (patch) | |
tree | aa987c9496ee667ff59eccab1681b49b363a44cd /src/libstore/misc.cc | |
parent | 8f1bf28505e6ba8fae35859391cbab7264b0014a (diff) | |
download | guix-d5eab2fc8293e0d14c7fd297bf7512257442295b.tar.gz |
* Use foreach in a lot of places.
Diffstat (limited to 'src/libstore/misc.cc')
-rw-r--r-- | src/libstore/misc.cc | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/src/libstore/misc.cc b/src/libstore/misc.cc index 85197adcf0..f2b4c7a4ee 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); } |