Skip to content

Commit 63dfce1

Browse files
author
Gabriel Sanches
committed
Refactor hash pool
1 parent a8ea0d3 commit 63dfce1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

hash_pool.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,14 @@ func newHashPool(hfunc func() hash.Hash) *hashPool {
1313
return &hashPool{&sync.Pool{New: func() interface{} { return hfunc() }}}
1414
}
1515

16-
func (hp *hashPool) sign(payload []byte) ([]byte, error) {
16+
func (hp *hashPool) sign(headerPayload []byte) ([]byte, error) {
1717
hh := hp.Pool.Get().(hash.Hash)
1818
defer func() {
1919
hh.Reset()
2020
hp.Pool.Put(hh)
2121
}()
2222

23-
if _, err := hh.Write(payload); err != nil {
23+
if _, err := hh.Write(headerPayload); err != nil {
2424
return nil, err
2525
}
2626
return hh.Sum(nil), nil

0 commit comments

Comments
 (0)