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
|
@ -68,7 +68,7 @@ func (n *NodeObject) UnmarshalJSON(data []byte) error {
|
|||
|
||||
switch len(m) {
|
||||
case 0:
|
||||
n.Node = new(HashNode)
|
||||
n.Node = EmptyNode{}
|
||||
case 1:
|
||||
if v, ok := m["hash"]; ok {
|
||||
var h util.Uint256
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue