Skip to content
This repository has been archived by the owner on Feb 27, 2023. It is now read-only.

Commit

Permalink
refactor: code deduplication
Browse files Browse the repository at this point in the history
  • Loading branch information
rach-id committed Nov 23, 2021
1 parent 37c1633 commit e6faf80
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions treehasher.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,7 @@ func (th *treeHasher) digestNode(leftData []byte, rightData []byte) ([]byte, []b
value = append(value, leftData...)
value = append(value, rightData...)

th.hasher.Write(value)
sum := th.hasher.Sum(nil)
th.hasher.Reset()
sum := th.digest(value)

return sum, value
}
Expand Down

0 comments on commit e6faf80

Please sign in to comment.