Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TieredStorage] Improve param naming of IndexBlockFormat #34033

Merged
merged 1 commit into from
Nov 13, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions accounts-db/src/tiered_storage/index.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,14 +80,14 @@ impl IndexBlockFormat {
&self,
map: &'a Mmap,
footer: &TieredStorageFooter,
offset: IndexOffset,
index_offset: IndexOffset,
) -> TieredStorageResult<&'a Pubkey> {
let offset = match self {
let account_offset = match self {
Self::AddressAndOffset => {
footer.index_block_offset as usize + std::mem::size_of::<Pubkey>() * offset.0
footer.index_block_offset as usize + std::mem::size_of::<Pubkey>() * index_offset.0
}
};
let (address, _) = get_type::<Pubkey>(map, offset)?;
let (address, _) = get_type::<Pubkey>(map, account_offset)?;
Ok(address)
}

Expand All @@ -96,14 +96,14 @@ impl IndexBlockFormat {
&self,
map: &Mmap,
footer: &TieredStorageFooter,
offset: IndexOffset,
index_offset: IndexOffset,
) -> TieredStorageResult<AccountOffset> {
match self {
Self::AddressAndOffset => {
let offset = footer.index_block_offset as usize
let account_offset = footer.index_block_offset as usize
+ std::mem::size_of::<Pubkey>() * footer.account_entry_count as usize
+ offset.0 * std::mem::size_of::<u64>();
let (account_block_offset, _) = get_type(map, offset)?;
+ index_offset.0 * std::mem::size_of::<u64>();
let (account_block_offset, _) = get_type(map, account_offset)?;
Ok(AccountOffset {
block: *account_block_offset,
})
Expand Down