mirror of https://github.com/golang/go.git
crypto/subtle: use min builtin function in XORBytes
Change-Id: Ibf57dbaaa54486823e0769714dec2e22d6c5ea9e
GitHub-Last-Rev: 31421d0668
GitHub-Pull-Request: golang/go#65748
Reviewed-on: https://go-review.googlesource.com/c/go/+/564577
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Filippo Valsorda <filippo@golang.org>
Reviewed-by: Damien Neil <dneil@google.com>
Auto-Submit: Filippo Valsorda <filippo@golang.org>
Reviewed-by: Than McIntosh <thanm@google.com>
This commit is contained in:
parent
63dd79c07b
commit
6e5080470c
|
|
@ -9,10 +9,7 @@ package subtle
|
|||
// If dst does not have length at least n,
|
||||
// XORBytes panics without writing anything to dst.
|
||||
func XORBytes(dst, x, y []byte) int {
|
||||
n := len(x)
|
||||
if len(y) < n {
|
||||
n = len(y)
|
||||
}
|
||||
n := min(len(x), len(y))
|
||||
if n == 0 {
|
||||
return 0
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue