mirror of
https://github.com/NixOS/nix
synced 2025-06-25 19:01:16 +02:00
remove Symbol::empty
the only use of this function is to determine whether a lambda has a non-set formal, but this use is arguably better served by Symbol::set and using a non-Symbol instead of an empty symbol in the parser when no such formal is present.
This commit is contained in:
parent
90b5c0a1a6
commit
ff0fd91ed2
5 changed files with 8 additions and 13 deletions
|
@ -1342,7 +1342,7 @@ void EvalState::callFunction(Value & fun, size_t nrArgs, Value * * args, Value &
|
|||
ExprLambda & lambda(*vCur.lambda.fun);
|
||||
|
||||
auto size =
|
||||
(lambda.arg.empty() ? 0 : 1) +
|
||||
(!lambda.arg.set() ? 0 : 1) +
|
||||
(lambda.hasFormals() ? lambda.formals->formals.size() : 0);
|
||||
Env & env2(allocEnv(size));
|
||||
env2.up = vCur.lambda.env;
|
||||
|
@ -1355,7 +1355,7 @@ void EvalState::callFunction(Value & fun, size_t nrArgs, Value * * args, Value &
|
|||
else {
|
||||
forceAttrs(*args[0], pos);
|
||||
|
||||
if (!lambda.arg.empty())
|
||||
if (lambda.arg.set())
|
||||
env2.values[displ++] = args[0];
|
||||
|
||||
/* For each formal argument, get the actual argument. If
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue