diff options
author | Oleg Kovalov <iamolegkovalov@gmail.com> | 2018-08-07 18:56:40 +0800 |
---|---|---|
committer | Péter Szilágyi <peterke@gmail.com> | 2018-08-07 18:56:40 +0800 |
commit | cf05ef9106779da0df62c0c03312fc489171aaa5 (patch) | |
tree | a2d5185dea85a478895b799da81e41f8e383cb52 /trie/node.go | |
parent | de9b0660acf26edc3b261b805c1a3454e3c76321 (diff) | |
download | dexon-cf05ef9106779da0df62c0c03312fc489171aaa5.tar dexon-cf05ef9106779da0df62c0c03312fc489171aaa5.tar.gz dexon-cf05ef9106779da0df62c0c03312fc489171aaa5.tar.bz2 dexon-cf05ef9106779da0df62c0c03312fc489171aaa5.tar.lz dexon-cf05ef9106779da0df62c0c03312fc489171aaa5.tar.xz dexon-cf05ef9106779da0df62c0c03312fc489171aaa5.tar.zst dexon-cf05ef9106779da0df62c0c03312fc489171aaa5.zip |
p2p, swarm, trie: avoid copying slices in loops (#17265)
Diffstat (limited to 'trie/node.go')
-rw-r--r-- | trie/node.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/trie/node.go b/trie/node.go index a06f1b389..1fafb7a53 100644 --- a/trie/node.go +++ b/trie/node.go @@ -55,7 +55,7 @@ var nilValueNode = valueNode(nil) func (n *fullNode) EncodeRLP(w io.Writer) error { var nodes [17]node - for i, child := range n.Children { + for i, child := range &n.Children { if child != nil { nodes[i] = child } else { @@ -98,7 +98,7 @@ func (n valueNode) String() string { return n.fstring("") } func (n *fullNode) fstring(ind string) string { resp := fmt.Sprintf("[\n%s ", ind) - for i, node := range n.Children { + for i, node := range &n.Children { if node == nil { resp += fmt.Sprintf("%s: <nil> ", indices[i]) } else { |