From 360736e6941c500f2f56cc7dc14721a17ca606f5 Mon Sep 17 00:00:00 2001 From: Tom French Date: Thu, 12 Oct 2023 00:00:24 +0100 Subject: [PATCH] chore: remove unnecessary clone when executing brillig --- .../src/ssa/acir_gen/acir_ir/acir_variable.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/compiler/noirc_evaluator/src/ssa/acir_gen/acir_ir/acir_variable.rs b/compiler/noirc_evaluator/src/ssa/acir_gen/acir_ir/acir_variable.rs index 325088dbf0b..7f04105e05f 100644 --- a/compiler/noirc_evaluator/src/ssa/acir_gen/acir_ir/acir_variable.rs +++ b/compiler/noirc_evaluator/src/ssa/acir_gen/acir_ir/acir_variable.rs @@ -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); } @@ -965,7 +965,7 @@ impl AcirContext { fn execute_brillig( &mut self, - code: Vec, + code: &[BrilligOpcode], inputs: &[BrilligInputs], outputs_types: &[AcirType], ) -> Option> { @@ -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, + code: &[BrilligOpcode], inputs: &[BrilligInputs], ) -> Option<(Registers, Vec)> { struct NullBbSolver; @@ -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();