From 5a15ee3f5dec9d3bb50283fb6219b489bdd7205d Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Thu, 11 Aug 2022 11:11:07 +0300 Subject: refactor(tvix/vm): simplify implementation of OpEqual 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 --- tvix/eval/src/vm.rs | 9 +-------- 1 file changed, 1 insertion(+), 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), -- cgit 1.4.1