From 6f9591ea23471a511fd283f58fc41a9ebf6abb51 Mon Sep 17 00:00:00 2001 From: ucwong Date: Fri, 3 Oct 2025 01:04:12 +0800 Subject: [PATCH] slices concat --- trie/sync.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/trie/sync.go b/trie/sync.go index 8f943d7f78..6c05d00306 100644 --- a/trie/sync.go +++ b/trie/sync.go @@ -25,6 +25,7 @@ import ( "github.com/CortexFoundation/CortexTheseus/core/rawdb" "github.com/CortexFoundation/CortexTheseus/core/types" "github.com/CortexFoundation/CortexTheseus/ctxcdb" + "slices" ) // ErrNotRequested is returned by the trie sync when it's requested to process a @@ -374,14 +375,14 @@ func (s *Sync) children(req *request, object node) ([]*request, error) { } children = []child{{ node: node.Val, - path: append(append([]byte(nil), req.path...), key...), + path: slices.Concat(req.path, key), }} case *fullNode: for i := 0; i < 17; i++ { if node.Children[i] != nil { children = append(children, child{ node: node.Children[i], - path: append(append([]byte(nil), req.path...), byte(i)), + path: append(slices.Clone(req.path), byte(i)), }) } }