-
Notifications
You must be signed in to change notification settings - Fork 741
MerkleDB Adjust New View function(s) #1927
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
Conversation
@@ -38,7 +38,6 @@ const ( | |||
) | |||
|
|||
var ( | |||
_ TrieView = (*merkleDB)(nil) |
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.
No longer needed.
if db.closed { | ||
return nil, database.ErrClosed | ||
} |
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.
Kind of weird that this was removed - but because this is an internal function it makes sense that this should never really happen anyways
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.
we always check it before we call this function, so it couldn't really happen as you said.
…avalanchego into MerkleDBAlternativeConstructor
Create a new map based NewView function which is easier to use for some callers. Add bool to both NewView functions to allow caller to specify if it is safe to not copy the []byte values. If it is safe to not copy, this unlocks a performance increase due to less allocations and copies.