Skip to content

Commit

Permalink
Merge pull request #16803 from karalabe/trie-avoid-funccall
Browse files Browse the repository at this point in the history
trie: cleaner logic, one less func call
  • Loading branch information
karalabe authored May 24, 2018
2 parents 55b579e + d318023 commit 54294b4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions trie/hasher.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}
Expand Down

0 comments on commit 54294b4

Please sign in to comment.