mpt: move empty hash node in a separate type
We use them quite frequently (consider children for a new branch node) and it is better to get rid of unneeded allocations. Signed-off-by: Evgeniy Stratonikov <evgeniy@nspcc.ru>
This commit is contained in:
parent
f02d8b4ec4
commit
db80ef28df
11 changed files with 124 additions and 99 deletions
|
@ -27,7 +27,7 @@ var _ Node = (*BranchNode)(nil)
|
|||
func NewBranchNode() *BranchNode {
|
||||
b := new(BranchNode)
|
||||
for i := 0; i < childrenCount; i++ {
|
||||
b.Children[i] = new(HashNode)
|
||||
b.Children[i] = EmptyNode{}
|
||||
}
|
||||
return b
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue