mirror of
https://github.com/paradigmxyz/reth.git
synced 2026-01-08 06:53:54 -05:00
perf(era-utils): replace Box<dyn Fn> with function pointer (#20701)
This commit is contained in:
@@ -170,18 +170,14 @@ where
|
||||
<P as NodePrimitivesProvider>::Primitives: NodePrimitives<BlockHeader = BH, BlockBody = BB>,
|
||||
{
|
||||
let reader = open(meta)?;
|
||||
let iter =
|
||||
reader
|
||||
.iter()
|
||||
.map(Box::new(decode)
|
||||
as Box<dyn Fn(Result<BlockTuple, E2sError>) -> eyre::Result<(BH, BB)>>);
|
||||
let iter = reader.iter().map(decode as fn(_) -> _);
|
||||
let iter = ProcessIter { iter, era: meta };
|
||||
|
||||
process_iter(iter, writer, provider, hash_collector, block_numbers)
|
||||
}
|
||||
|
||||
type ProcessInnerIter<R, BH, BB> =
|
||||
Map<BlockTupleIterator<R>, Box<dyn Fn(Result<BlockTuple, E2sError>) -> eyre::Result<(BH, BB)>>>;
|
||||
Map<BlockTupleIterator<R>, fn(Result<BlockTuple, E2sError>) -> eyre::Result<(BH, BB)>>;
|
||||
|
||||
/// An iterator that wraps era file extraction. After the final item [`EraMeta::mark_as_processed`]
|
||||
/// is called to ensure proper cleanup.
|
||||
|
||||
Reference in New Issue
Block a user