mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-22 04:36:42 +00:00
Update test_hash.go
This commit is contained in:
parent
bd77b77ede
commit
4773a557b2
1 changed files with 3 additions and 3 deletions
|
|
@ -23,7 +23,6 @@
|
||||||
package blocktest
|
package blocktest
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"bytes"
|
|
||||||
"hash"
|
"hash"
|
||||||
|
|
||||||
"github.com/ethereum/go-ethereum/common"
|
"github.com/ethereum/go-ethereum/common"
|
||||||
|
|
@ -49,8 +48,9 @@ func (h *testHasher) Reset() {
|
||||||
|
|
||||||
// Update updates the hash state with the given key and value.
|
// Update updates the hash state with the given key and value.
|
||||||
func (h *testHasher) Update(key, val []byte) error {
|
func (h *testHasher) Update(key, val []byte) error {
|
||||||
h.hasher.Write(bytes.Clone(key))
|
// The hasher copies input data, so avoid redundant Clone allocations.
|
||||||
h.hasher.Write(bytes.Clone(val))
|
h.hasher.Write(key)
|
||||||
|
h.hasher.Write(val)
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue