Unverified Commit 54294b45 authored by Péter Szilágyi's avatar Péter Szilágyi Committed by GitHub

Merge pull request #16803 from karalabe/trie-avoid-funccall

trie: cleaner logic, one less func call
parents 55b579e0 d3180231
......@@ -196,12 +196,12 @@ func (h *hasher) store(n node, db *Database, force bool) (node, error) {
if h.onleaf != nil {
switch n := n.(type) {
case *shortNode:
if child, ok := n.Val.(valueNode); ok {
if child, ok := n.Val.(valueNode); ok && child != nil {
h.onleaf(child, hash)
}
case *fullNode:
for i := 0; i < 16; i++ {
if child, ok := n.Children[i].(valueNode); ok {
if child, ok := n.Children[i].(valueNode); ok && child != nil {
h.onleaf(child, hash)
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment