diff options
author | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2015-07-17 19:24:28 +0200 |
---|---|---|
committer | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2015-07-17 20:13:56 +0200 |
commit | 6bd2c7bb386de16310fa5534275e6e638be60862 (patch) | |
tree | 0a12144dfb4e8d1b069bc09d583b522b5c158b28 /src/libstore/optimise-store.cc | |
parent | 1511aa9f488ba0762c2da0bf8ab61b5fde47305d (diff) |
OCD: foreach -> C++11 ranged for
Diffstat (limited to 'src/libstore/optimise-store.cc')
-rw-r--r-- | src/libstore/optimise-store.cc | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/libstore/optimise-store.cc b/src/libstore/optimise-store.cc index 55c252b9b..6f6696179 100644 --- a/src/libstore/optimise-store.cc +++ b/src/libstore/optimise-store.cc @@ -99,8 +99,8 @@ void LocalStore::optimisePath_(OptimiseStats & stats, const Path & path, InodeHa if (S_ISDIR(st.st_mode)) { Strings names = readDirectoryIgnoringInodes(path, inodeHash); - foreach (Strings::iterator, i, names) - optimisePath_(stats, path + "/" + *i, inodeHash); + for (auto & i : names) + optimisePath_(stats, path + "/" + i, inodeHash); return; } @@ -218,11 +218,11 @@ void LocalStore::optimiseStore(OptimiseStats & stats) PathSet paths = queryAllValidPaths(); InodeHash inodeHash = loadInodeHash(); - 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); - optimisePath_(stats, *i, inodeHash); + for (auto & i : paths) { + addTempRoot(i); + if (!isValidPath(i)) continue; /* path was GC'ed, probably */ + startNest(nest, lvlChatty, format("hashing files in ‘%1%’") % i); + optimisePath_(stats, i, inodeHash); } } |