Skip to content

Commit 1199b3a

Browse files
authored
chore: use copy(to, from) instead of a loop (#1326)
1 parent af5a5e5 commit 1199b3a

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

pkg/authentication/scramcredentials/scram_credentials.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,9 +80,7 @@ func hmacIteration(hashConstructor func() hash.Hash, input, salt []byte, iterati
8080

8181
intermediateDigest := hmacHash.Sum(nil)
8282

83-
for i := 0; i < len(intermediateDigest); i++ {
84-
result[i] = intermediateDigest[i]
85-
}
83+
copy(result, intermediateDigest)
8684

8785
for i := 1; i < iterationCount; i++ {
8886
hmacHash.Reset()

0 commit comments

Comments
 (0)