From 240d1851db25f3cca3b324bd9fb7c6edcb2a4e8e Mon Sep 17 00:00:00 2001 From: Guillaume Ballet Date: Wed, 15 Jul 2020 10:00:04 +0200 Subject: [PATCH] trie: quell linter in commiter.go (#21329) --- trie/committer.go | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/trie/committer.go b/trie/committer.go index 00f20827a..2f3d2a463 100644 --- a/trie/committer.go +++ b/trie/committer.go @@ -105,20 +105,19 @@ func (c *committer) commit(n node, db *Database, force bool) (node, error) { // Commit child collapsed := cn.copy() if _, ok := cn.Val.(valueNode); !ok { - if childV, err := c.commit(cn.Val, db, false); err != nil { + childV, err := c.commit(cn.Val, db, false) + if err != nil { return nil, err - } else { - collapsed.Val = childV } + collapsed.Val = childV } // The key needs to be copied, since we're delivering it to database collapsed.Key = hexToCompact(cn.Key) hashedNode := c.store(collapsed, db, force, true) if hn, ok := hashedNode.(hashNode); ok { return hn, nil - } else { - return collapsed, nil } + return collapsed, nil case *fullNode: hashedKids, hasVnodes, err := c.commitChildren(cn, db, force) if err != nil { @@ -130,9 +129,8 @@ func (c *committer) commit(n node, db *Database, force bool) (node, error) { hashedNode := c.store(collapsed, db, force, hasVnodes) if hn, ok := hashedNode.(hashNode); ok { return hn, nil - } else { - return collapsed, nil } + return collapsed, nil case valueNode: return c.store(cn, db, force, false), nil // hashnodes aren't stored @@ -265,7 +263,7 @@ func estimateSize(n node) int { if child := n.Children[i]; child != nil { s += estimateSize(child) } else { - s += 1 + s++ } } return s