trie: use clear builtin

This commit is contained in:
Felix Lange 2025-06-19 12:44:36 +02:00
parent 1791b95016
commit 8441958355

View file

@ -270,7 +270,7 @@ func (t *StateTrie) Commit(collectLeaf bool) (common.Hash, *trienode.NodeSet) {
if t.preimages != nil {
t.preimages.InsertPreimage(t.secKeyCache)
}
t.secKeyCache = make(map[common.Hash][]byte)
clear(t.secKeyCache)
}
// Commit the trie and return its modified nodeset.
return t.trie.Commit(collectLeaf)