Skip to content

Commit

Permalink
chore: remove unnecessary clone when executing brillig (noir-lang#3120)
Browse files Browse the repository at this point in the history
Co-authored-by: Tom French <git@tomfren.ch>
  • Loading branch information
2 people authored and Sakapoi committed Oct 19, 2023
1 parent 7803c6e commit dd3813c
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -878,7 +878,7 @@ impl AcirContext {
// Optimistically try executing the brillig now, if we can complete execution they just return the results.
// This is a temporary measure pending SSA optimizations being applied to Brillig which would remove constant-input opcodes (See #2066)
if let Some(brillig_outputs) =
self.execute_brillig(generated_brillig.byte_code.clone(), &b_inputs, &outputs)
self.execute_brillig(&generated_brillig.byte_code, &b_inputs, &outputs)
{
return Ok(brillig_outputs);
}
Expand Down Expand Up @@ -965,7 +965,7 @@ impl AcirContext {

fn execute_brillig(
&mut self,
code: Vec<BrilligOpcode>,
code: &[BrilligOpcode],
inputs: &[BrilligInputs],
outputs_types: &[AcirType],
) -> Option<Vec<AcirValue>> {
Expand Down Expand Up @@ -1238,7 +1238,7 @@ pub(crate) struct AcirVar(usize);
///
/// Returns `None` if complete execution of the Brillig bytecode is not possible.
fn execute_brillig(
code: Vec<BrilligOpcode>,
code: &[BrilligOpcode],
inputs: &[BrilligInputs],
) -> Option<(Registers, Vec<Value>)> {
struct NullBbSolver;
Expand Down Expand Up @@ -1294,7 +1294,7 @@ fn execute_brillig(

// Instantiate a Brillig VM given the solved input registers and memory, along with the Brillig bytecode.
let input_registers = Registers::load(input_register_values);
let mut vm = VM::new(input_registers, input_memory, &code, Vec::new(), &NullBbSolver);
let mut vm = VM::new(input_registers, input_memory, code, Vec::new(), &NullBbSolver);

// Run the Brillig VM on these inputs, bytecode, etc!
let vm_status = vm.process_opcodes();
Expand Down

0 comments on commit dd3813c

Please sign in to comment.