aboutsummaryrefslogtreecommitdiff
path: root/src/nix/build.cc
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2021-01-18 22:50:39 +0100
committerEelco Dolstra <edolstra@gmail.com>2021-01-18 22:50:39 +0100
commit555940f0659e95de7f890ede48e2faba096b3d6d (patch)
tree72881461239958e6f5f235d76f9e3e727b336fa4 /src/nix/build.cc
parentea756b3654931f23839aee9f461a8c891c6ffe43 (diff)
Use enumerate()
Diffstat (limited to 'src/nix/build.cc')
-rw-r--r--src/nix/build.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/nix/build.cc b/src/nix/build.cc
index 4cb8ade08..45f63bb7e 100644
--- a/src/nix/build.cc
+++ b/src/nix/build.cc
@@ -58,7 +58,7 @@ struct CmdBuild : InstallablesCommand, MixDryRun, MixJSON, MixProfile
if (outLink != "")
if (auto store2 = store.dynamic_pointer_cast<LocalFSStore>())
- for (size_t i = 0; i < buildables.size(); ++i)
+ for (const auto & [i, buildable] : enumerate(buildables)) {
std::visit(overloaded {
[&](BuildableOpaque bo) {
std::string symlink = outLink;
@@ -74,7 +74,8 @@ struct CmdBuild : InstallablesCommand, MixDryRun, MixJSON, MixProfile
store2->addPermRoot(output.second, absPath(symlink));
}
},
- }, buildables[i]);
+ }, buildable);
+ }
updateProfile(buildables);