trie: quell linter warnings in commiter.go (#21329) (#945)

This commit is contained in:
Daniel Liu 2025-04-16 17:10:42 +08:00 committed by GitHub
parent bf893cb73b
commit 5759893f2b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -109,9 +109,8 @@ func (c *committer) commit(n node, db *Database) (node, error) {
hashedNode := c.store(collapsed, db) hashedNode := c.store(collapsed, db)
if hn, ok := hashedNode.(hashNode); ok { if hn, ok := hashedNode.(hashNode); ok {
return hn, nil return hn, nil
} else {
return collapsed, nil
} }
return collapsed, nil
case *fullNode: case *fullNode:
hashedKids, err := c.commitChildren(cn, db) hashedKids, err := c.commitChildren(cn, db)
if err != nil { if err != nil {
@ -256,7 +255,7 @@ func estimateSize(n node) int {
if child := n.Children[i]; child != nil { if child := n.Children[i]; child != nil {
s += estimateSize(child) s += estimateSize(child)
} else { } else {
s += 1 s++
} }
} }
return s return s
@ -266,6 +265,5 @@ func estimateSize(n node) int {
return 1 + len(n) return 1 + len(n)
default: default:
panic(fmt.Sprintf("Node type %T", n)) panic(fmt.Sprintf("Node type %T", n))
} }
} }