Skip to content
This repository has been archived by the owner on Apr 9, 2024. It is now read-only.

Commit

Permalink
chore: remove unnecessary mutability
Browse files Browse the repository at this point in the history
  • Loading branch information
TomAFrench committed Jun 16, 2023
1 parent ba4eee1 commit 80efb3d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 12 deletions.
2 changes: 1 addition & 1 deletion acvm/src/pwg/brillig.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ pub(super) struct BrilligSolver;
impl BrilligSolver {
pub(super) fn solve(
initial_witness: &mut WitnessMap,
brillig: &mut Brillig,
brillig: &Brillig,
) -> Result<OpcodeResolution, OpcodeResolutionError> {
// If the predicate is `None`, then we simply return the value 1
// If the predicate is `Some` but we cannot find a value, then we return stalled
Expand Down
13 changes: 2 additions & 11 deletions acvm/src/pwg/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,6 @@ impl<B: PartialWitnessGenerator> ACVM<B> {
let mut stalled = true;
let mut opcode_not_solvable = None;
for opcode in &self.opcodes {
let mut solved_brillig_data = None;
let resolution = match opcode {
Opcode::Arithmetic(expr) => {
ArithmeticSolver::solve(&mut self.witness_map, expr)
Expand All @@ -128,11 +127,7 @@ impl<B: PartialWitnessGenerator> ACVM<B> {
self.blocks.solve(block.id, &block.trace, &mut self.witness_map)
}
Opcode::Brillig(brillig) => {
let mut brillig_clone = brillig.clone();
let result =
BrilligSolver::solve(&mut self.witness_map, &mut brillig_clone);
solved_brillig_data = Some(brillig_clone);
result
BrilligSolver::solve(&mut self.witness_map, brillig)
}
};
match resolution {
Expand Down Expand Up @@ -163,11 +158,7 @@ impl<B: PartialWitnessGenerator> ACVM<B> {
// We push those opcodes not solvable to the back as
// it could be because the opcodes are out of order, i.e. this assignment
// relies on a later opcodes' results
if let Some(brillig) = solved_brillig_data {
unresolved_opcodes.push(Opcode::Brillig(brillig));
} else {
unresolved_opcodes.push(opcode.clone());
}
unresolved_opcodes.push(opcode.clone());
}
Err(OpcodeResolutionError::OpcodeNotSolvable(_)) => {
unreachable!("ICE - Result should have been converted to GateResolution")
Expand Down

0 comments on commit 80efb3d

Please sign in to comment.