diff options
author | Eelco Dolstra <edolstra@gmail.com> | 2021-11-25 17:13:25 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-11-25 17:13:25 +0100 |
commit | 6f46434f3226784e809158a04a8067036f9e6291 (patch) | |
tree | 8c0bf081829aab6f1d2230efb1e7e5f09fdbdbde /src/libexpr/flake/flake.cc | |
parent | 986906e687cc4d3b456592f72a0081c4a9adb1db (diff) | |
parent | b6c8e57056f81fa3c2827a7fdc6f335ec54727bd (diff) |
Merge pull request #5648 from edolstra/list-iter
Support range-based for loop over list values
Diffstat (limited to 'src/libexpr/flake/flake.cc')
-rw-r--r-- | src/libexpr/flake/flake.cc | 3 |
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)); |