chore(trie): safe to share prefixset (#6846)

This commit is contained in:
Roman Krasiuk
2024-02-28 16:02:36 +01:00
committed by GitHub
parent 0f26cd6df3
commit fa4277cdda

View File

@@ -1,7 +1,7 @@
use reth_primitives::{trie::Nibbles, B256};
use std::{
collections::{HashMap, HashSet},
rc::Rc,
sync::Arc,
};
mod loader;
@@ -121,7 +121,7 @@ impl PrefixSetMut {
self.keys.dedup();
}
PrefixSet { keys: Rc::new(self.keys), index: self.index }
PrefixSet { keys: Arc::new(self.keys), index: self.index }
}
}
@@ -130,7 +130,7 @@ impl PrefixSetMut {
/// See also [PrefixSetMut::freeze].
#[derive(Debug, Default, Clone)]
pub struct PrefixSet {
keys: Rc<Vec<Nibbles>>,
keys: Arc<Vec<Nibbles>>,
index: usize,
}