Skip to content

Commit

Permalink
use copy instead of clone
Browse files Browse the repository at this point in the history
  • Loading branch information
sirasistant committed Jul 22, 2024
1 parent bac255f commit fb94971
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions noir/noir-repo/acvm-repo/brillig_vm/src/memory.rs
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ pub struct Memory<F> {
impl<F: AcirField> Memory<F> {
/// Gets the value at pointer
pub fn read(&self, ptr: MemoryAddress) -> MemoryValue<F> {
self.inner.get(ptr.to_usize()).cloned().unwrap_or_default()
self.inner.get(ptr.to_usize()).copied().unwrap_or_default()
}

pub fn read_ref(&self, ptr: MemoryAddress) -> MemoryAddress {
Expand Down Expand Up @@ -268,7 +268,7 @@ impl<F: AcirField> Memory<F> {
/// Sets the values after pointer `ptr` to `values`
pub fn write_slice(&mut self, ptr: MemoryAddress, values: &[MemoryValue<F>]) {
self.resize_to_fit(ptr.to_usize() + values.len());
self.inner[ptr.to_usize()..(ptr.to_usize() + values.len())].clone_from_slice(values);
self.inner[ptr.to_usize()..(ptr.to_usize() + values.len())].copy_from_slice(values);
}

/// Returns the values of the memory
Expand Down

0 comments on commit fb94971

Please sign in to comment.