aboutsummaryrefslogtreecommitdiff
path: root/src/libstore/optimise-store.cc
diff options
context:
space:
mode:
authorEelco Dolstra <e.dolstra@tudelft.nl>2009-04-21 11:52:16 +0000
committerEelco Dolstra <e.dolstra@tudelft.nl>2009-04-21 11:52:16 +0000
commitd5eab2fc8293e0d14c7fd297bf7512257442295b (patch)
treeaa987c9496ee667ff59eccab1681b49b363a44cd /src/libstore/optimise-store.cc
parent8f1bf28505e6ba8fae35859391cbab7264b0014a (diff)
* Use foreach in a lot of places.
Diffstat (limited to 'src/libstore/optimise-store.cc')
-rw-r--r--src/libstore/optimise-store.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/libstore/optimise-store.cc b/src/libstore/optimise-store.cc
index 590e1f2e1..2246fa826 100644
--- a/src/libstore/optimise-store.cc
+++ b/src/libstore/optimise-store.cc
@@ -131,7 +131,7 @@ static void hashAndLink(bool dryRun, HashToPath & hashToPath,
if (S_ISDIR(st.st_mode)) {
Strings names = readDirectory(path);
- for (Strings::iterator i = names.begin(); i != names.end(); ++i)
+ foreach (Strings::iterator, i, names)
hashAndLink(dryRun, hashToPath, stats, path + "/" + *i);
}
}
@@ -143,7 +143,7 @@ void LocalStore::optimiseStore(bool dryRun, OptimiseStats & stats)
PathSet paths = queryValidPaths();
- for (PathSet::iterator i = paths.begin(); i != paths.end(); ++i) {
+ foreach (PathSet::iterator, i, paths) {
addTempRoot(*i);
if (!isValidPath(*i)) continue; /* path was GC'ed, probably */
startNest(nest, lvlChatty, format("hashing files in `%1%'") % *i);