Skip to content

Commit

Permalink
chore(trie): safe to share prefixset (paradigmxyz#6846)
Browse files Browse the repository at this point in the history
  • Loading branch information
rkrasiuk authored and fgimenez committed Feb 29, 2024
1 parent 1e67ba4 commit 1b03372
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions crates/trie/src/prefix_set/mod.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use reth_primitives::{trie::Nibbles, B256};
use std::{
collections::{HashMap, HashSet},
rc::Rc,
sync::Arc,
};

mod loader;
Expand Down Expand Up @@ -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 }
}
}

Expand All @@ -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,
}

Expand Down

0 comments on commit 1b03372

Please sign in to comment.