Skip to content

Commit

Permalink
Merge branch 'master' into tf/pure-logic-or
Browse files Browse the repository at this point in the history
  • Loading branch information
TomAFrench authored Jan 2, 2024
2 parents 3186b04 + e58844d commit 439fb27
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 57 deletions.
4 changes: 4 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,10 @@ This strategy avoids scenarios where pull requests grow too large/out-of-scope a

The easiest way to do this is to have multiple Conventional Commits while you work and then you can cherry-pick the smaller changes into separate branches for pull requesting.

### Typos and other small changes

Significant changes, like new features or important bug fixes, typically have a more pronounced impact on the project’s overall development. For smaller fixes, such as typos, we encourage you to report them instead of opening PRs. This approach helps us manage our resources effectively and ensures that every change contributes meaningfully to the project. PRs involving such smaller fixes will likely be closed and incorporated in PRs authored by the core team.

### Reviews

For any repository in the noir-lang organization, we require code review & approval by __one__ Noir team member before the changes are merged, as enforced by GitHub branch protection. Non-breaking pull requests may be merged at any time. Breaking pull requests should only be merged when the team has general agreement of the changes and is preparing a breaking release.
Expand Down
72 changes: 16 additions & 56 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -530,8 +530,19 @@ impl AcirContext {
let lhs_data = self.vars[&lhs].clone();
let rhs_data = self.vars[&rhs].clone();
let result = match (lhs_data, rhs_data) {
// (x * 1) == (1 * x) == x
(AcirVarData::Const(constant), _) if constant.is_one() => rhs,
(_, AcirVarData::Const(constant)) if constant.is_one() => lhs,

// (x * 0) == (0 * x) == 0
(AcirVarData::Const(constant), _) | (_, AcirVarData::Const(constant))
if constant.is_zero() =>
{
self.add_constant(FieldElement::zero())
}

(AcirVarData::Const(lhs_constant), AcirVarData::Const(rhs_constant)) => {
self.add_data(AcirVarData::Const(lhs_constant * rhs_constant))
self.add_constant(lhs_constant * rhs_constant)
}
(AcirVarData::Witness(witness), AcirVarData::Const(constant))
| (AcirVarData::Const(constant), AcirVarData::Witness(witness)) => {
Expand Down

0 comments on commit 439fb27

Please sign in to comment.