perf: query accounts with &Address to avoid copying address (#13554)

This commit is contained in:
Hai | RISE
2024-12-25 19:31:28 +07:00
committed by GitHub
parent 14c1c0be69
commit 031f430b8f
27 changed files with 74 additions and 71 deletions

View File

@ -862,8 +862,8 @@ impl<TX: DbTxMut + DbTx + 'static, N: NodeTypes> DatabaseProvider<TX, N> {
}
impl<TX: DbTx, N: NodeTypes> AccountReader for DatabaseProvider<TX, N> {
fn basic_account(&self, address: Address) -> ProviderResult<Option<Account>> {
Ok(self.tx.get::<tables::PlainAccountState>(address)?)
fn basic_account(&self, address: &Address) -> ProviderResult<Option<Account>> {
Ok(self.tx.get_by_encoded_key::<tables::PlainAccountState>(address)?)
}
}