Skip to content

Commit

Permalink
Satisfy Clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
jfecher committed Jan 30, 2024
1 parent 16689ee commit 0c22691
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 15 deletions.
23 changes: 9 additions & 14 deletions compiler/noirc_evaluator/src/ssa/function_builder/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -494,21 +494,16 @@ impl FunctionBuilder {
// This is a bit odd, but in brillig the inc_rc instruction operates on
// a copy of the array's metadata, so we need to re-store a loaded array
// even if there have been no other changes to it.
match &self.current_function.dfg[value] {
Value::Instruction { instruction, .. } => {
match &self.current_function.dfg[*instruction] {
Instruction::Load { address } => {
// We can't re-use `value` in case the original address was stored
// to again in the meantime. So introduce another load.
let address = *address;
let value = self.insert_load(address, typ);
self.insert_instruction(Instruction::IncrementRc { value }, None);
self.insert_store(address, value);
}
_ => (),
}
if let Value::Instruction { instruction, .. } = &self.current_function.dfg[value] {
let instruction = &self.current_function.dfg[*instruction];
if let Instruction::Load { address } = instruction {
// We can't re-use `value` in case the original address was stored
// to again in the meantime. So introduce another load.
let address = *address;
let value = self.insert_load(address, typ);
self.insert_instruction(Instruction::IncrementRc { value }, None);
self.insert_store(address, value);
}
_ => (),
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion compiler/noirc_evaluator/src/ssa/ssa_gen/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -680,7 +680,7 @@ impl<'a> FunctionContext<'a> {

rhs.clone().for_each(|value| {
let value = value.eval(self);
self.builder.increment_array_reference_count(value)
self.builder.increment_array_reference_count(value);
});

self.assign_new_value(lhs, rhs);
Expand Down

0 comments on commit 0c22691

Please sign in to comment.