refactor: make snapshot.New() for loop obvious

This commit is contained in:
Arran Schlosberg 2024-11-21 17:14:34 +00:00
parent 9e3eb14570
commit f86318ca1a
No known key found for this signature in database
GPG key ID: 5DD5567C12C5F312

View file

@ -218,9 +218,8 @@ func New(config Config, diskdb ethdb.KeyValueStore, triedb *triedb.Database, roo
return snap, nil return snap, nil
} }
// Existing snapshot loaded, seed all the layers // Existing snapshot loaded, seed all the layers
for head != nil { for ; head != nil; head = head.Parent() {
snap.layers[head.Root()] = head snap.layers[head.Root()] = head
head = head.Parent()
} }
return snap, nil return snap, nil
} }