From 9298d2db884c4e3f9474880e3dcfd080ef9eacfa Mon Sep 17 00:00:00 2001 From: maskpp Date: Tue, 25 Jun 2024 21:45:33 +0800 Subject: [PATCH] trie/trienode: remove unnecessary check in Summary (#30047) --- trie/trienode/node.go | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/trie/trienode/node.go b/trie/trienode/node.go index fa7bebe4f9..09f355f3b5 100644 --- a/trie/trienode/node.go +++ b/trie/trienode/node.go @@ -139,16 +139,14 @@ func (set *NodeSet) Size() (int, int) { func (set *NodeSet) Summary() string { var out = new(strings.Builder) fmt.Fprintf(out, "nodeset owner: %v\n", set.Owner) - if set.Nodes != nil { - for path, n := range set.Nodes { - // Deletion - if n.IsDeleted() { - fmt.Fprintf(out, " [-]: %x\n", path) - continue - } - // Insertion or update - fmt.Fprintf(out, " [+/*]: %x -> %v \n", path, n.Hash) + for path, n := range set.Nodes { + // Deletion + if n.IsDeleted() { + fmt.Fprintf(out, " [-]: %x\n", path) + continue } + // Insertion or update + fmt.Fprintf(out, " [+/*]: %x -> %v \n", path, n.Hash) } for _, n := range set.Leaves { fmt.Fprintf(out, "[leaf]: %v\n", n)