simplify 2 StorableAccounts impls (#30054)

This commit is contained in:
Jeff Washington (jwash) 2023-02-01 14:08:28 -06:00 committed by GitHub
parent d048a1903f
commit c8ed54acbd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 6 deletions

View File

@ -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]
@ -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
}
}
@ -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]
@ -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
}
}