small refactoring (#6531)

This commit is contained in:
Thomas Coratger
2024-02-10 22:21:40 +01:00
committed by GitHub
parent 1bc75d974d
commit 8cfa5efe62
6 changed files with 21 additions and 35 deletions

View File

@ -128,12 +128,7 @@ impl<Client, Pool, Tasks, Builder> BasicPayloadJobGenerator<Client, Pool, Tasks,
/// Returns the pre-cached reads for the given parent block if it matches the cached state's
/// block.
fn maybe_pre_cached(&self, parent: B256) -> Option<CachedReads> {
let pre_cached = self.pre_cached.as_ref()?;
if pre_cached.block == parent {
Some(pre_cached.cached.clone())
} else {
None
}
self.pre_cached.as_ref().filter(|pc| pc.block == parent).map(|pc| pc.cached.clone())
}
}