From 6bd2c7bb386de16310fa5534275e6e638be60862 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Fri, 17 Jul 2015 19:24:28 +0200 Subject: OCD: foreach -> C++11 ranged for --- src/nix-daemon/nix-daemon.cc | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'src/nix-daemon') diff --git a/src/nix-daemon/nix-daemon.cc b/src/nix-daemon/nix-daemon.cc index ad8b0d133..02d552a62 100644 --- a/src/nix-daemon/nix-daemon.cc +++ b/src/nix-daemon/nix-daemon.cc @@ -367,9 +367,9 @@ static void performOp(bool trusted, unsigned int clientVersion, Roots roots = store->findRoots(); stopWork(); writeInt(roots.size(), to); - for (Roots::iterator i = roots.begin(); i != roots.end(); ++i) { - writeString(i->first, to); - writeString(i->second, to); + for (auto & i : roots) { + writeString(i.first, to); + writeString(i.second, to); } break; } @@ -464,12 +464,12 @@ static void performOp(bool trusted, unsigned int clientVersion, store->querySubstitutablePathInfos(paths, infos); stopWork(); writeInt(infos.size(), to); - foreach (SubstitutablePathInfos::iterator, i, infos) { - writeString(i->first, to); - writeString(i->second.deriver, to); - writeStrings(i->second.references, to); - writeLongLong(i->second.downloadSize, to); - writeLongLong(i->second.narSize, to); + for (auto & i : infos) { + writeString(i.first, to); + writeString(i.second.deriver, to); + writeStrings(i.second.references, to); + writeLongLong(i.second.downloadSize, to); + writeLongLong(i.second.narSize, to); } break; } -- cgit v1.2.3