mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
perf: query accounts with &Address to avoid copying address (#13554)
This commit is contained in:
@ -1019,7 +1019,7 @@ mod tests {
|
||||
}
|
||||
|
||||
impl AccountReader for MockStateProvider {
|
||||
fn basic_account(&self, _address: Address) -> ProviderResult<Option<Account>> {
|
||||
fn basic_account(&self, _address: &Address) -> ProviderResult<Option<Account>> {
|
||||
Ok(None)
|
||||
}
|
||||
}
|
||||
|
||||
@ -96,9 +96,9 @@ impl<N: NodePrimitives> BlockHashReader for MemoryOverlayStateProviderRef<'_, N>
|
||||
}
|
||||
|
||||
impl<N: NodePrimitives> AccountReader for MemoryOverlayStateProviderRef<'_, N> {
|
||||
fn basic_account(&self, address: Address) -> ProviderResult<Option<Account>> {
|
||||
fn basic_account(&self, address: &Address) -> ProviderResult<Option<Account>> {
|
||||
for block in &self.in_memory {
|
||||
if let Some(account) = block.execution_output.account(&address) {
|
||||
if let Some(account) = block.execution_output.account(address) {
|
||||
return Ok(account);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user