Skip to content

Commit

Permalink
Further simplify the functions
Browse files Browse the repository at this point in the history
  • Loading branch information
yhchiang-sol committed Mar 22, 2024
1 parent 79e949f commit 732964a
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions accounts-db/src/accounts_file.rs
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ impl AccountsFile {
Self::TieredStorage(ts) => ts
.reader()?
.get_account(IndexOffset(index as u32))
.unwrap_or(None)
.ok()?
.map(|(metas, index_offset)| (metas, index_offset.0 as usize)),
}
}
Expand Down Expand Up @@ -197,11 +197,7 @@ impl AccountsFile {
Self::AppendVec(av) => av.accounts(offset),
Self::TieredStorage(ts) => ts
.reader()
.map(|reader| {
reader
.accounts(IndexOffset(offset as u32))
.unwrap_or_default()
})
.and_then(|reader| reader.accounts(IndexOffset(offset as u32)).ok())
.unwrap_or_default(),
}
}
Expand Down

0 comments on commit 732964a

Please sign in to comment.