about summary refs log tree commit diff
path: root/tvix/eval/src/value
diff options
context:
space:
mode:
authorVincent Ambo <mail@tazj.in>2022-08-24T18·13+0300
committertazjin <tazjin@tvl.su>2022-09-02T15·45+0000
commit1416f1ab8a1a4e3c0e9895014c1c08187615cece (patch)
treeb9ba25df8cae0f3a200b79d8f606f1de9512c721 /tvix/eval/src/value
parentbabc2493160ea5f25492b281161bdd19660c8261 (diff)
refactor(tvix/eval): avoid a use of Value::Blackhole r/4601
The blackhole allocation is not going to be cheaper than cloning this.

Change-Id: Id3ad44812decb4392830be06645e67bb0a982b96
Reviewed-on: https://cl.tvl.fyi/c/depot/+/6267
Reviewed-by: grfn <grfn@gws.fyi>
Tested-by: BuildkiteCI
Diffstat (limited to 'tvix/eval/src/value')
-rw-r--r--tvix/eval/src/value/attrs.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/tvix/eval/src/value/attrs.rs b/tvix/eval/src/value/attrs.rs
index bbff79fc0d1a..fffd316cbfa2 100644
--- a/tvix/eval/src/value/attrs.rs
+++ b/tvix/eval/src/value/attrs.rs
@@ -39,8 +39,8 @@ impl AttrsRep {
 
             AttrsRep::KV { name, value } => {
                 *self = AttrsRep::Map(BTreeMap::from([
-                    (NixString::NAME, std::mem::replace(name, Value::Blackhole)),
-                    (NixString::VALUE, std::mem::replace(value, Value::Blackhole)),
+                    (NixString::NAME, name.clone()),
+                    (NixString::VALUE, value.clone()),
                 ]));
                 self.map_mut()
             }