Skip to content

Commit

Permalink
Merge pull request #324 from testwill/bytes
Browse files Browse the repository at this point in the history
perf: use bytes.Equal instead of bytes.Compare
  • Loading branch information
q191201771 authored Oct 20, 2023
2 parents 3f10132 + 4ae1be8 commit e4f0bcb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/rtmp/handshake.go
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ func findDigest(b []byte, base int, key []byte) int {
digest := make([]byte, keyLen)
makeDigestWithoutCenterPart(b, offs, key, digest)
// compare origin digest in buffer with calced digest
if bytes.Compare(digest, b[offs:offs+keyLen]) == 0 {
if bytes.Equal(digest, b[offs : offs+keyLen]) {
return offs
}
return -1
Expand Down

0 comments on commit e4f0bcb

Please sign in to comment.