mirror of
https://github.com/NixOS/nix
synced 2025-06-26 07:31:15 +02:00
Bindings: Add a method for iterating in lexicographically sorted order
This commit is contained in:
parent
b1f001538e
commit
54801ed6ad
4 changed files with 28 additions and 28 deletions
|
@ -91,13 +91,9 @@ static void printValue(std::ostream & str, std::set<const Value *> & active, con
|
|||
break;
|
||||
case tAttrs: {
|
||||
str << "{ ";
|
||||
typedef std::map<string, Value *> Sorted;
|
||||
Sorted sorted;
|
||||
for (auto & i : *v.attrs)
|
||||
sorted[i.name] = i.value;
|
||||
for (auto & i : sorted) {
|
||||
str << i.first << " = ";
|
||||
printValue(str, active, *i.second);
|
||||
for (auto & i : v.attrs->lexicographicOrder()) {
|
||||
str << i->name << " = ";
|
||||
printValue(str, active, *i->value);
|
||||
str << "; ";
|
||||
}
|
||||
str << "}";
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue