Use structured binding for json iteration

This commit is contained in:
Jacek Galowicz 2023-11-07 13:39:30 +01:00
parent 77dceb2844
commit c581143e0c

View file

@ -137,9 +137,8 @@ struct NarAccessor : public SourceAccessor
if (type == "directory") {
member.stat = {.type = Type::tDirectory};
for (auto i = v["entries"].begin(); i != v["entries"].end(); ++i) {
std::string name = i.key();
recurse(member.children[name], i.value());
for (const auto &[name, function] : v["entries"].items()) {
recurse(member.children[name], function);
}
} else if (type == "regular") {
member.stat = {