1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-07-02 05:11:47 +02:00

* Use foreach in a lot of places.

This commit is contained in:
Eelco Dolstra 2009-04-21 11:52:16 +00:00
parent 8f1bf28505
commit d5eab2fc82
10 changed files with 59 additions and 96 deletions

View file

@ -155,7 +155,7 @@ bool PathLocks::lockPaths(const PathSet & _paths,
paths.sort();
/* Acquire the lock for each path. */
for (Paths::iterator i = paths.begin(); i != paths.end(); i++) {
foreach (Paths::iterator, i, paths) {
checkInterrupt();
Path path = *i;
Path lockPath = path + ".lock";
@ -219,7 +219,7 @@ PathLocks::~PathLocks()
void PathLocks::unlock()
{
for (list<FDPair>::iterator i = fds.begin(); i != fds.end(); i++) {
foreach (list<FDPair>::iterator, i, fds) {
if (deletePaths) deleteLockFilePreClose(i->second, i->first);
lockedPaths.erase(i->second);