Skip to content

Commit

Permalink
trie: cleaner logic, one less func call
Browse files Browse the repository at this point in the history
  • Loading branch information
karalabe authored and kimmyeonghun committed Jul 5, 2018
1 parent c058496 commit 6171d72
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 6171d72

Please sign in to comment.