From c4a98d2ddb0230c68b46c47add798f90a9b7efef Mon Sep 17 00:00:00 2001 From: Daniel Liu <139250065@qq.com> Date: Tue, 3 Jun 2025 11:50:02 +0800 Subject: [PATCH] trie: remove redundant conversions (#1056) --- trie/database.go | 2 +- trie/iterator.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/trie/database.go b/trie/database.go index 6d7a160654..ee470c3f8a 100644 --- a/trie/database.go +++ b/trie/database.go @@ -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 } diff --git a/trie/iterator.go b/trie/iterator.go index 032e668c30..6dda492740 100644 --- a/trie/iterator.go +++ b/trie/iterator.go @@ -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")