mirror of https://github.com/golang/go.git
slices: fix Equal contract
slices.Equal only requires comparable, not Ordered. Change-Id: I0150f1370e478aaa33bbd8788a1f9c9d33b85e06 Reviewed-on: https://team-review.git.corp.google.com/c/golang/go2-dev/+/716483 Reviewed-by: Robert Griesemer <gri@google.com> Reviewed-by: Ian Lance Taylor <iant@google.com>
This commit is contained in:
parent
63d4750592
commit
7a57f4d76e
|
|
@ -13,7 +13,7 @@ import (
|
|||
|
||||
// Equal reports whether two slices are equal: the same length and all
|
||||
// elements equal. All floating point NaNs are considered equal.
|
||||
func Equal(type Elem contracts.Ordered)(s1, s2 []Elem) bool {
|
||||
func Equal(type Elem comparable)(s1, s2 []Elem) bool {
|
||||
if len(s1) != len(s2) {
|
||||
return false
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue