Skip to content

Commit

Permalink
simplify 2 StorableAccounts impls (solana-labs#30054)
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffwashington authored Feb 1, 2023
1 parent d048a19 commit c8ed54a
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions runtime/src/storable_accounts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ impl<'a> StorableAccounts<'a, StoredAccountMeta<'a>>
for (Slot, &'a [&'a StoredAccountMeta<'a>], IncludeSlotInHash)
{
fn pubkey(&self, index: usize) -> &Pubkey {
self.1[index].pubkey()
self.account(index).pubkey()
}
fn account(&self, index: usize) -> &StoredAccountMeta<'a> {
self.1[index]
Expand All @@ -155,10 +155,10 @@ impl<'a> StorableAccounts<'a, StoredAccountMeta<'a>>
true
}
fn hash(&self, index: usize) -> &Hash {
self.1[index].hash
self.account(index).hash
}
fn write_version(&self, index: usize) -> u64 {
self.1[index].meta.write_version_obsolete
self.account(index).meta.write_version_obsolete
}
}

Expand All @@ -173,7 +173,7 @@ impl<'a> StorableAccounts<'a, StoredAccountMeta<'a>>
)
{
fn pubkey(&self, index: usize) -> &Pubkey {
self.1[index].pubkey()
self.account(index).pubkey()
}
fn account(&self, index: usize) -> &StoredAccountMeta<'a> {
self.1[index]
Expand All @@ -198,10 +198,10 @@ impl<'a> StorableAccounts<'a, StoredAccountMeta<'a>>
true
}
fn hash(&self, index: usize) -> &Hash {
self.1[index].hash
self.account(index).hash
}
fn write_version(&self, index: usize) -> u64 {
self.1[index].meta.write_version_obsolete
self.account(index).meta.write_version_obsolete
}
}

Expand Down

0 comments on commit c8ed54a

Please sign in to comment.