Skip to content

Commit

Permalink
Merge branch 'master' into nargo-execute
Browse files Browse the repository at this point in the history
* master:
  chore: readability improvements (#726)
  • Loading branch information
TomAFrench committed Feb 1, 2023
2 parents 3e856b1 + f18a760 commit 95f8d95
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 12 deletions.
8 changes: 4 additions & 4 deletions crates/noirc_evaluator/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -235,10 +235,10 @@ impl Evaluator {
typ: &AbiType,
) -> Result<Vec<Witness>, RuntimeErrorKind> {
let mut witnesses = Vec::new();
let mut element_width = None;
if let AbiType::Integer { width, .. } = typ {
element_width = Some(*width);
}
let element_width = match typ {
AbiType::Integer { width, .. } => Some(*width),
_ => None,
};
for _ in 0..*length {
let witness = self.add_witness_to_cs();
witnesses.push(witness);
Expand Down
14 changes: 6 additions & 8 deletions crates/noirc_evaluator/src/ssa/acir_gen.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1402,16 +1402,14 @@ fn try_range_constraint(w: Witness, bits: u32, evaluator: &mut Evaluator) {
}

pub fn is_unit(arith: &Expression) -> Option<Witness> {
if arith.mul_terms.is_empty()
&& arith.linear_combinations.len() == 1
&& arith.linear_combinations[0].0 == FieldElement::one()
&& arith.q_c == FieldElement::zero()
{
return Some(arith.linear_combinations[0].1);
}
if arith.mul_terms.is_empty() && arith.linear_combinations.len() == 1 {
//todo!("should be simplified");
if arith.linear_combinations[0].0.is_one() && arith.q_c.is_zero() {
return Some(arith.linear_combinations[0].1);
} else {
//todo!("should be simplified");
}
}

None
}
pub fn from_witness(witness: Witness) -> Expression {
Expand Down

0 comments on commit 95f8d95

Please sign in to comment.