about summary refs log tree commit diff
diff options
context:
space:
mode:
authorVincent Ambo <mail@tazj.in>2022-08-11T08·11+0300
committertazjin <tazjin@tvl.su>2022-08-25T11·34+0000
commit5a15ee3f5dec9d3bb50283fb6219b489bdd7205d (patch)
treef856080b51efc9134b6eaa5c07cca0aba56bab37
parent7d55b776de29cfaa70a2ab9ae61b6cabe70ed637 (diff)
refactor(tvix/vm): simplify implementation of OpEqual r/4477
This can now fully delegate to PartialEq of Value

Change-Id: Iaa9f4ec9b8830d516d72f83a93ab2df9a6e5697c
Reviewed-on: https://cl.tvl.fyi/c/depot/+/6142
Tested-by: BuildkiteCI
Reviewed-by: sterni <sternenseemann@systemli.org>
-rw-r--r--tvix/eval/src/vm.rs9
1 files changed, 1 insertions, 8 deletions
diff --git a/tvix/eval/src/vm.rs b/tvix/eval/src/vm.rs
index 7a1082344e34..db2f76d73145 100644
--- a/tvix/eval/src/vm.rs
+++ b/tvix/eval/src/vm.rs
@@ -104,14 +104,7 @@ impl VM {
                     let v2 = self.pop();
                     let v1 = self.pop();
 
-                    let eq = match (v1, v2) {
-                        (Value::Float(f), Value::Integer(i))
-                        | (Value::Integer(i), Value::Float(f)) => f == (i as f64),
-
-                        (v1, v2) => v1 == v2,
-                    };
-
-                    self.push(Value::Bool(eq))
+                    self.push(Value::Bool(v1 == v2))
                 }
 
                 OpCode::OpNull => self.push(Value::Null),