mirror of
https://github.com/paradigmxyz/reth.git
synced 2026-02-19 03:04:27 -05:00
perf(trie): preserve allocations in sparse trie wipe() (#21089)
This commit is contained in:
@@ -3045,7 +3045,8 @@ impl SparseSubtrie {
|
||||
/// Removes all nodes and values from the subtrie, resetting it to a blank state
|
||||
/// with only an empty root node. This is used when a storage root is deleted.
|
||||
fn wipe(&mut self) {
|
||||
self.nodes = HashMap::from_iter([(Nibbles::default(), SparseNode::Empty)]);
|
||||
self.nodes.clear();
|
||||
self.nodes.insert(Nibbles::default(), SparseNode::Empty);
|
||||
self.inner.clear();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user