1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-28 17:51:15 +02:00

callFunction: Use std::span

This is a bit safer than having a separate nrArgs argument.
This commit is contained in:
Eelco Dolstra 2024-11-12 19:26:39 +01:00
parent 14edb78d53
commit a2e4a4c238
5 changed files with 22 additions and 27 deletions

View file

@ -690,13 +690,12 @@ public:
bool isFunctor(Value & fun);
// FIXME: use std::span
void callFunction(Value & fun, size_t nrArgs, Value * * args, Value & vRes, const PosIdx pos);
void callFunction(Value & fun, std::span<Value *> args, Value & vRes, const PosIdx pos);
void callFunction(Value & fun, Value & arg, Value & vRes, const PosIdx pos)
{
Value * args[] = {&arg};
callFunction(fun, 1, args, vRes, pos);
callFunction(fun, args, vRes, pos);
}
/**