mirror of https://github.com/golang/go.git
crypto/subtle: use min in XORBytes
Change-Id: Ib06fc808baf248433f569a52d4340f30a2a56ead
This commit is contained in:
parent
185f31bf30
commit
31421d0668
|
|
@ -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