forked from lix-project/lix
Use structured binding for json iteration
This commit is contained in:
parent
77dceb2844
commit
c581143e0c
|
@ -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 = {
|
||||||
|
|
Loading…
Reference in a new issue