Skip to content

Commit

Permalink
chore: use copy(to, from) instead of a loop (#1326)
Browse files Browse the repository at this point in the history
  • Loading branch information
testwill authored Sep 25, 2023
1 parent af5a5e5 commit 1199b3a
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions pkg/authentication/scramcredentials/scram_credentials.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,7 @@ func hmacIteration(hashConstructor func() hash.Hash, input, salt []byte, iterati

intermediateDigest := hmacHash.Sum(nil)

for i := 0; i < len(intermediateDigest); i++ {
result[i] = intermediateDigest[i]
}
copy(result, intermediateDigest)

for i := 1; i < iterationCount; i++ {
hmacHash.Reset()
Expand Down

0 comments on commit 1199b3a

Please sign in to comment.