mirror of
https://github.com/NixOS/nix.git
synced 2025-11-12 05:26:02 +01:00
libexpr: Use proxy ListView for all Value list accesses
This also makes it possible to make `payload` field private in the `ValueStorage` class template.
This commit is contained in:
parent
c39cc00404
commit
e73fcf7b53
16 changed files with 309 additions and 116 deletions
|
|
@ -50,11 +50,13 @@ void printAmbiguous(
|
|||
break;
|
||||
}
|
||||
case nList:
|
||||
if (seen && v.listSize() && !seen->insert(v.listElems()).second)
|
||||
/* Use pointer to the Value instead of pointer to the elements, because
|
||||
that would need to explicitly handle the case of SmallList. */
|
||||
if (seen && v.listSize() && !seen->insert(&v).second)
|
||||
str << "«repeated»";
|
||||
else {
|
||||
str << "[ ";
|
||||
for (auto v2 : v.listItems()) {
|
||||
for (auto v2 : v.listView()) {
|
||||
if (v2)
|
||||
printAmbiguous(*v2, symbols, str, seen, depth - 1);
|
||||
else
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue