1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-11-09 03:56:01 +01:00

libexpr: Remove non-const overload of listElems

This overload isn't actually necessary anywhere and
doesn't make much sense. The pointers to `Value`s are
themselves const, but the `Value`s are mutable.
A non-const member function implies that the object itself
can be modified but this doesn't make much sense considering
the return type: `Value * const * `, which is a pointer
to a constant array of pointers to mutable values.

(cherry picked from commit 7b46eb9958)
This commit is contained in:
Sergei Zimmerman 2025-06-12 22:29:05 +00:00 committed by Mergify
parent 0877680b08
commit 223d3222b3

View file

@ -451,11 +451,6 @@ public:
return internalType == tList1 || internalType == tList2 || internalType == tListN; return internalType == tList1 || internalType == tList2 || internalType == tListN;
} }
Value * const * listElems()
{
return internalType == tList1 || internalType == tList2 ? payload.smallList : payload.bigList.elems;
}
std::span<Value * const> listItems() const std::span<Value * const> listItems() const
{ {
assert(isList()); assert(isList());