Skip to content

Commit 7ca9cb7

Browse files
MegaRedHandxqft
authored andcommitted
refactor(l1): remove unneeded clone and Arc (#5252)
**Motivation** We had a useless `Arc` in the layering module. **Description** This PR removes the `Arc`, which also lets us remove a clone we had in the `commit` function.
1 parent b9c0823 commit 7ca9cb7

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

crates/storage/trie_db/layering.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ use ethrex_trie::{Nibbles, TrieDB, TrieError};
77

88
#[derive(Debug, Clone)]
99
struct TrieLayer {
10-
nodes: Arc<FxHashMap<Vec<u8>, Vec<u8>>>,
10+
nodes: FxHashMap<Vec<u8>, Vec<u8>>,
1111
parent: H256,
1212
id: usize,
1313
}
@@ -126,7 +126,7 @@ impl TrieLayerCache {
126126

127127
self.last_id += 1;
128128
let entry = TrieLayer {
129-
nodes: Arc::new(nodes),
129+
nodes,
130130
parent,
131131
id: self.last_id,
132132
};
@@ -188,7 +188,7 @@ impl TrieLayerCache {
188188
parent_nodes
189189
.unwrap_or_default()
190190
.into_iter()
191-
.chain(layer.nodes.as_ref().clone())
191+
.chain(layer.nodes)
192192
.collect(),
193193
)
194194
}

0 commit comments

Comments
 (0)