Function tvix_eval::value::attrs::attempt_optimise_kv

source ยท
fn attempt_optimise_kv(slice: &mut [Value]) -> Option<NixAttrs>
Expand description

In Nix, name/value attribute pairs are frequently constructed from literals. This particular case should avoid allocation of a map, additional heap values etc. and use the optimised KV variant instead.

`slice` is the top of the stack from which the attrset is being
constructed, e.g.

  slice: [ "value" 5 "name" "foo" ]
  index:   0       1 2      3
  stack:   3       2 1      0