From 346a2164d29b93ff7a5a6848eb83460647729a26 Mon Sep 17 00:00:00 2001 From: Kevaundray Wedderburn Date: Tue, 30 May 2023 15:58:23 +0100 Subject: [PATCH] update code to flip the arguments --- .../ssa_refactor/acir_gen/acir_ir/acir_variable.rs | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/crates/noirc_evaluator/src/ssa_refactor/acir_gen/acir_ir/acir_variable.rs b/crates/noirc_evaluator/src/ssa_refactor/acir_gen/acir_ir/acir_variable.rs index bf3455f7c0a..ebd40679aae 100644 --- a/crates/noirc_evaluator/src/ssa_refactor/acir_gen/acir_ir/acir_variable.rs +++ b/crates/noirc_evaluator/src/ssa_refactor/acir_gen/acir_ir/acir_variable.rs @@ -321,14 +321,10 @@ impl AcirContext { lhs: AcirVar, rhs: AcirVar, ) -> Result { - // Flip the result of calling more than equal method to - // compute less than. - let comparison = self.more_than_eq_var(lhs, rhs)?; - - let one = self.add_constant(FieldElement::one()); - let comparison_negated = self.sub_var(one, comparison); - - Ok(comparison_negated) + // Flip inputs of more than equal call to compute + // less than + // ie x < y , is the same as y >= x + Ok(self.more_than_eq_var(rhs, lhs)?) } /// Terminates the context and takes the resulting `GeneratedAcir`