-
Notifications
You must be signed in to change notification settings - Fork 20.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
core/state/snapshot: simplify snapshot rebuild #30772
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very elegant, looks good to me!
Seems to get stuck though :)
|
New()
Whoops, I read the |
@holiman sorry for the post-approval push. I just made the for loop obvious as I and another developer I spoke to both assumed it was an |
This PR is purely for improved readability; I was doing work involving the file and think this may help others who are trying to understand what's going on.
snapshot.Tree.Rebuild()
now returns a function that blocks until regeneration is complete, allowingTree.waitBuild()
to be removed entirely as all it did was search for thedone
channel behind this new function.New()
is also simplified by (a) only waiting if!AsyncBuild
; and (b) avoiding the double negative ofif !NoBuild
.