trie: remove redundant conversions (#1056)

This commit is contained in:
Daniel Liu 2025-06-03 11:50:02 +08:00 committed by GitHub
parent aa7c8644c3
commit c4a98d2ddb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 2 additions and 2 deletions

View file

@ -99,7 +99,7 @@ func (n rawNode) cache() (hashNode, bool) { panic("this should never end up in
func (n rawNode) fstring(ind string) string { panic("this should never end up in a live trie") }
func (n rawNode) EncodeRLP(w io.Writer) error {
_, err := w.Write([]byte(n))
_, err := w.Write(n)
return err
}

View file

@ -173,7 +173,7 @@ func (it *nodeIterator) LeafKey() []byte {
func (it *nodeIterator) LeafBlob() []byte {
if len(it.stack) > 0 {
if node, ok := it.stack[len(it.stack)-1].node.(valueNode); ok {
return []byte(node)
return node
}
}
panic("not at leaf")