aboutsummaryrefslogtreecommitdiff
path: root/src/libexpr/flake/flake.cc
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2021-11-24 20:21:34 +0100
committerEelco Dolstra <edolstra@gmail.com>2021-11-25 16:31:39 +0100
commitb6c8e57056f81fa3c2827a7fdc6f335ec54727bd (patch)
tree5339262007e54fb12a7c1fdce3d2fa30147534db /src/libexpr/flake/flake.cc
parentca82967ee3276e2aa8b02ea7e6d19cfd4fa75f4c (diff)
Support range-based for loop over list values
Diffstat (limited to 'src/libexpr/flake/flake.cc')
-rw-r--r--src/libexpr/flake/flake.cc3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/libexpr/flake/flake.cc b/src/libexpr/flake/flake.cc
index f5be67d67..06136579e 100644
--- a/src/libexpr/flake/flake.cc
+++ b/src/libexpr/flake/flake.cc
@@ -257,8 +257,7 @@ static Flake getFlake(
flake.config.settings.insert({setting.name, state.forceBool(*setting.value, *setting.pos)});
else if (setting.value->type() == nList) {
std::vector<std::string> ss;
- for (unsigned int n = 0; n < setting.value->listSize(); ++n) {
- auto elem = setting.value->listElems()[n];
+ for (auto elem : setting.value->listItems()) {
if (elem->type() != nString)
throw TypeError("list element in flake configuration setting '%s' is %s while a string is expected",
setting.name, showType(*setting.value));