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") { if (type == "directory") {
member.stat = {.type = Type::tDirectory}; member.stat = {.type = Type::tDirectory};
for (auto i = v["entries"].begin(); i != v["entries"].end(); ++i) { for (const auto &[name, function] : v["entries"].items()) {
std::string name = i.key(); recurse(member.children[name], function);
recurse(member.children[name], i.value());
} }
} else if (type == "regular") { } else if (type == "regular") {
member.stat = { member.stat = {