mirror of
https://github.com/arnaucube/ark-r1cs-std.git
synced 2026-01-10 16:01:28 +01:00
Prefer to return error rather than ? them,
avoid return when it cant be early (in a simple if-else)
This commit is contained in:
committed by
Pratyush Mishra
parent
10c6e85c1a
commit
d71bc5a675
@@ -681,7 +681,7 @@ impl<ConstraintF: Field> ConditionalEqGadget<ConstraintF> for Boolean {
|
||||
// 1 - 1 = 0 - 0 = 0
|
||||
(Constant(true), Constant(true)) | (Constant(false), Constant(false)) => return Ok(()),
|
||||
// false != true
|
||||
(Constant(_), Constant(_)) => Err(SynthesisError::AssignmentMissing)?,
|
||||
(Constant(_), Constant(_)) => return Err(SynthesisError::AssignmentMissing),
|
||||
// 1 - a
|
||||
(Constant(true), Is(a)) | (Is(a), Constant(true)) => {
|
||||
LinearCombination::zero() + one - a.get_variable()
|
||||
|
||||
Reference in New Issue
Block a user