From 1c789657638b194b5884719913799a39c49bacda Mon Sep 17 00:00:00 2001 From: wborgeaud Date: Fri, 13 Aug 2021 15:24:38 +0200 Subject: [PATCH] better --- src/gadgets/arithmetic_extension.rs | 6 +++--- src/util/reducing.rs | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/gadgets/arithmetic_extension.rs b/src/gadgets/arithmetic_extension.rs index 1d65180e..25328f25 100644 --- a/src/gadgets/arithmetic_extension.rs +++ b/src/gadgets/arithmetic_extension.rs @@ -72,7 +72,7 @@ impl, const D: usize> CircuitBuilder { second_addend: ExtensionTarget, ) -> (ExtensionTarget, ExtensionTarget) { if let Some((g, c_0, c_1)) = self.free_arithmetic { - if g == self.num_gates() - 1 && c_0 == const_0 && c_1 == const_1 { + if c_0 == const_0 && c_1 == const_1 { return self.yo( g, first_multiplicand_0, @@ -236,7 +236,7 @@ impl, const D: usize> CircuitBuilder { let (a0, b0) = chunk[0]; let (a1, b1) = chunk[1]; let (gate, range) = if let Some((g, c_0, c_1)) = self.free_arithmetic { - if g == self.num_gates() - 1 && c_0 == constant && c_1 == F::ONE { + if c_0 == constant && c_1 == F::ONE { (g, ArithmeticExtensionGate::::wires_third_output()) } else { ( @@ -480,7 +480,7 @@ impl, const D: usize> CircuitBuilder { ) -> ExtensionTarget { let zero = self.zero_extension(); let (gate, range) = if let Some((g, c_0, c_1)) = self.free_arithmetic { - if g == self.num_gates() - 1 && c_0 == F::ONE && c_1 == F::ONE { + if c_0 == F::ONE && c_1 == F::ONE { (g, ArithmeticExtensionGate::::wires_third_output()) } else { ( diff --git a/src/util/reducing.rs b/src/util/reducing.rs index 3d10956a..459454db 100644 --- a/src/util/reducing.rs +++ b/src/util/reducing.rs @@ -183,7 +183,7 @@ impl ReducingFactorTarget { // acc' = out_1 = alpha out_0 + pair[1] let (gate, range) = if let Some((g, c_0, c_1)) = builder.free_arithmetic { - if g == builder.num_gates() - 1 && c_0 == F::ONE && c_1 == F::ONE { + if c_0 == F::ONE && c_1 == F::ONE { (g, ArithmeticExtensionGate::::wires_third_output()) } else { (