trie: prefer nil slices over zero-length slices (#19084)
This commit is contained in:
committed by
Felix Lange
parent
f1537b774c
commit
514a9472ad
@@ -157,7 +157,7 @@ func (s *Sync) AddRawEntry(hash common.Hash, depth int, parent common.Hash) {
|
||||
|
||||
// Missing retrieves the known missing nodes from the trie for retrieval.
|
||||
func (s *Sync) Missing(max int) []common.Hash {
|
||||
requests := []common.Hash{}
|
||||
var requests []common.Hash
|
||||
for !s.queue.Empty() && (max == 0 || len(requests) < max) {
|
||||
requests = append(requests, s.queue.PopItem().(common.Hash))
|
||||
}
|
||||
@@ -254,7 +254,7 @@ func (s *Sync) children(req *request, object node) ([]*request, error) {
|
||||
node node
|
||||
depth int
|
||||
}
|
||||
children := []child{}
|
||||
var children []child
|
||||
|
||||
switch node := (object).(type) {
|
||||
case *shortNode:
|
||||
|
Reference in New Issue
Block a user