Skip to content

Commit

Permalink
remove unnecessary check
Browse files Browse the repository at this point in the history
  • Loading branch information
lulf committed Jan 8, 2024
1 parent 6015241 commit 6ae7b09
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
4 changes: 0 additions & 4 deletions src/item.rs
Original file line number Diff line number Diff line change
Expand Up @@ -510,10 +510,6 @@ impl ItemHeaderIter {
flash: &mut S,
callback: impl Fn(&ItemHeader, u32) -> ControlFlow<(), ()>,
) -> Result<(Option<ItemHeader>, u32), Error<S::Error>> {
if self.current_address >= self.end_address {
return Ok((None, self.current_address));
}

loop {
match ItemHeader::read_new(flash, self.current_address, self.end_address).await {
Ok(Some(header)) => {
Expand Down
4 changes: 2 additions & 2 deletions src/mock_flash.rs
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ impl<const PAGES: usize, const BYTES_PER_WORD: usize, const PAGE_WORDS: usize>
crate::calculate_page_end_address::<Self>(Self::FULL_FLASH_RANGE, page_index)
- Self::WORD_SIZE as u32;

let mut it = crate::item::HeaderIter::new(page_data_start, page_data_end);
let mut it = crate::item::ItemHeaderIter::new(page_data_start, page_data_end);
while let (Some(header), item_address) =
block_on(it.traverse(self, |_, _| core::ops::ControlFlow::Break(()))).unwrap()
{
Expand Down Expand Up @@ -185,7 +185,7 @@ impl<const PAGES: usize, const BYTES_PER_WORD: usize, const PAGE_WORDS: usize>
- Self::WORD_SIZE as u32;

let mut found_item = None;
let mut it = crate::item::HeaderIter::new(page_data_start, page_data_end);
let mut it = crate::item::ItemHeaderIter::new(page_data_start, page_data_end);
while let (Some(header), item_address) =
block_on(it.traverse(self, |_, _| ControlFlow::Break(()))).unwrap()
{
Expand Down

0 comments on commit 6ae7b09

Please sign in to comment.