Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: remove unnecessary clone when executing brillig #3120

Merged
merged 1 commit into from
Oct 12, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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