From daf3f2c11ff467b600473a2fda7bd513aacc1efa Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Fri, 1 Aug 2014 16:37:47 +0200 Subject: Make readDirectory() return inode / file type --- src/nix-env/profiles.cc | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'src/nix-env/profiles.cc') diff --git a/src/nix-env/profiles.cc b/src/nix-env/profiles.cc index f7b306890d4c..074a5e8c9db8 100644 --- a/src/nix-env/profiles.cc +++ b/src/nix-env/profiles.cc @@ -42,12 +42,11 @@ Generations findGenerations(Path profile, int & curGen) Path profileDir = dirOf(profile); string profileName = baseNameOf(profile); - Strings names = readDirectory(profileDir); - for (Strings::iterator i = names.begin(); i != names.end(); ++i) { + for (auto & i : readDirectory(profileDir)) { int n; - if ((n = parseName(profileName, *i)) != -1) { + if ((n = parseName(profileName, i.name)) != -1) { Generation gen; - gen.path = profileDir + "/" + *i; + gen.path = profileDir + "/" + i.name; gen.number = n; struct stat st; if (lstat(gen.path.c_str(), &st) != 0) -- cgit 1.4.1