mirror of
https://github.com/NixOS/nix
synced 2025-06-24 22:11:15 +02:00
functionArgs: Allocate bools only once
This commit is contained in:
parent
8c6e0df45f
commit
1fcdd1640e
3 changed files with 9 additions and 2 deletions
|
@ -2845,8 +2845,7 @@ static void prim_functionArgs(EvalState & state, const PosIdx pos, Value * * arg
|
|||
|
||||
auto attrs = state.buildBindings(args[0]->lambda.fun->formals->formals.size());
|
||||
for (auto & i : args[0]->lambda.fun->formals->formals)
|
||||
// !!! should optimise booleans (allocate only once)
|
||||
attrs.alloc(i.name, i.pos).mkBool(i.def);
|
||||
attrs.insert(i.name, state.getBool(i.def), i.pos);
|
||||
v.mkAttrs(attrs);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue