From 1416f1ab8a1a4e3c0e9895014c1c08187615cece Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Wed, 24 Aug 2022 21:13:29 +0300 Subject: refactor(tvix/eval): avoid a use of Value::Blackhole 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 Tested-by: BuildkiteCI --- tvix/eval/src/value/attrs.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tvix') 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() } -- cgit 1.4.1