Skip to content

Commit

Permalink
feat: optimize memory using when Importer works. (cosmos#625)
Browse files Browse the repository at this point in the history
Co-authored-by: lizhi <[email protected]>
  • Loading branch information
prolenking and lizhi authored Nov 23, 2022
1 parent 4b0dac8 commit c00c250
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion import.go
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,8 @@ func (i *Importer) Add(exportNode *ExportNode) error {
case node.leftHash != nil || node.rightHash != nil:
i.stack = i.stack[:stackSize-1]
}
i.stack = append(i.stack, node)
// Only hash\height\size of the node will be used after it be pushed into the stack.
i.stack = append(i.stack, &Node{hash: node.hash, subtreeHeight: node.subtreeHeight, size: node.size})

return nil
}
Expand Down

0 comments on commit c00c250

Please sign in to comment.