Skip to content

Commit

Permalink
changes hasher constructors to return a pointer-to (#1642)
Browse files Browse the repository at this point in the history
fixes #1641
  • Loading branch information
chavacava committed Apr 19, 2022
1 parent fbcac8c commit 0836bb8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions utils.go
Expand Up @@ -510,11 +510,11 @@ var (
)

func newMd5Hasher() md5simd.Hasher {
return hashWrapper{Hash: md5Pool.Get().(hash.Hash), isMD5: true}
return &hashWrapper{Hash: md5Pool.Get().(hash.Hash), isMD5: true}
}

func newSHA256Hasher() md5simd.Hasher {
return hashWrapper{Hash: sha256Pool.Get().(hash.Hash), isSHA256: true}
return &hashWrapper{Hash: sha256Pool.Get().(hash.Hash), isSHA256: true}
}

// hashWrapper implements the md5simd.Hasher interface.
Expand All @@ -525,7 +525,7 @@ type hashWrapper struct {
}

// Close will put the hasher back into the pool.
func (m hashWrapper) Close() {
func (m *hashWrapper) Close() {
if m.isMD5 && m.Hash != nil {
m.Reset()
md5Pool.Put(m.Hash)
Expand Down

0 comments on commit 0836bb8

Please sign in to comment.