@@ -84,20 +84,19 @@ func (h *hasher) hash(n node, force bool) (hashed node, cached node) {
8484 }
8585 return hashed , cached
8686 default :
87- // Value and hash nodes don't have children so they're left as were
87+ // Value and hash nodes don't have children, so they're left as were
8888 return n , n
8989 }
9090}
9191
9292// hashShortNodeChildren collapses the short node. The returned collapsed node
9393// holds a live reference to the Key, and must not be modified.
94- // The cached
9594func (h * hasher ) hashShortNodeChildren (n * shortNode ) (collapsed , cached * shortNode ) {
9695 // Hash the short node's child, caching the newly hashed subtree
9796 collapsed , cached = n .copy (), n .copy ()
9897 // Previously, we did copy this one. We don't seem to need to actually
9998 // do that, since we don't overwrite/reuse keys
100- //cached.Key = common.CopyBytes(n.Key)
99+ // cached.Key = common.CopyBytes(n.Key)
101100 collapsed .Key = hexToCompact (n .Key )
102101 // Unless the child is a valuenode or hashnode, hash it
103102 switch n .Val .(type ) {
@@ -153,7 +152,7 @@ func (h *hasher) shortnodeToHash(n *shortNode, force bool) node {
153152 return h .hashData (enc )
154153}
155154
156- // shortnodeToHash is used to creates a hashNode from a set of hashNodes , (which
155+ // fullnodeToHash is used to create a hashNode from a fullNode , (which
157156// may contain nil values)
158157func (h * hasher ) fullnodeToHash (n * fullNode , force bool ) node {
159158 n .encode (h .encbuf )
@@ -203,7 +202,7 @@ func (h *hasher) proofHash(original node) (collapsed, hashed node) {
203202 fn , _ := h .hashFullNodeChildren (n )
204203 return fn , h .fullnodeToHash (fn , false )
205204 default :
206- // Value and hash nodes don't have children so they're left as were
205+ // Value and hash nodes don't have children, so they're left as were
207206 return n , n
208207 }
209208}
0 commit comments