mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
perf: replace BytesMut with alloy_rlp::encode (#7170)
This commit is contained in:
committed by
GitHub
parent
f7d3cc5a09
commit
5b94dbb697
@ -8,7 +8,7 @@ use crate::{
|
||||
B256, U256,
|
||||
};
|
||||
use alloy_rlp::Encodable;
|
||||
use bytes::{BufMut, BytesMut};
|
||||
use bytes::BufMut;
|
||||
use itertools::Itertools;
|
||||
|
||||
/// Adjust the index of an item for rlp encoding.
|
||||
@ -32,8 +32,8 @@ pub fn ordered_trie_root_with_encoder<T, F>(items: &[T], mut encode: F) -> B256
|
||||
where
|
||||
F: FnMut(&T, &mut dyn BufMut),
|
||||
{
|
||||
let mut index_buffer = BytesMut::new();
|
||||
let mut value_buffer = BytesMut::new();
|
||||
let mut index_buffer = Vec::new();
|
||||
let mut value_buffer = Vec::new();
|
||||
|
||||
let mut hb = HashBuilder::default();
|
||||
let items_len = items.len();
|
||||
|
||||
Reference in New Issue
Block a user