From d31802312a7ae1ed816daf8fe674efd42493adb1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C3=A9ter=20Szil=C3=A1gyi?= Date: Thu, 24 May 2018 13:46:45 +0300 Subject: [PATCH] trie: cleaner logic, one less func call --- trie/hasher.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/trie/hasher.go b/trie/hasher.go index 2fc44787ac..ff61e70922 100644 --- a/trie/hasher.go +++ b/trie/hasher.go @@ -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) } }