Skip to content

Commit

Permalink
Use libcore to memset a slice.
Browse files Browse the repository at this point in the history
The API exists, we might as well use it.
  • Loading branch information
thejpster committed Oct 29, 2024
1 parent 2c836db commit 83831c0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
4 changes: 1 addition & 3 deletions src/blockdevice.rs
Original file line number Diff line number Diff line change
Expand Up @@ -140,9 +140,7 @@ where
/// Access a blank sector
pub fn blank_mut(&mut self, block_idx: BlockIdx) -> &mut Block {
self.block_idx = Some(block_idx);
for b in self.block[0].iter_mut() {
*b = 0;
}
self.block[0].fill(0);
&mut self.block[0]
}

Expand Down
4 changes: 1 addition & 3 deletions src/sdcard/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -341,9 +341,7 @@ where
return Err(Error::ReadError);
}

for b in buffer.iter_mut() {
*b = 0xFF;
}
buffer.fill(0xFF);
self.transfer_bytes(buffer)?;

// These two bytes are always sent. They are either a valid CRC, or
Expand Down

0 comments on commit 83831c0

Please sign in to comment.