mirror of
https://github.com/golang/go
synced 2024-11-11 19:41:36 -07:00
Oh well
This commit is contained in:
parent
336dd86b34
commit
a8a223871f
@ -60,7 +60,8 @@ func isNaN[T Ordered](x T) bool {
|
||||
|
||||
// Or returns the first of its arguments that is not equal to the zero value.
|
||||
// If no argument is non-zero, it returns the zero value.
|
||||
func Or[T any](vals ...T) T {
|
||||
func Or[T comparable](vals ...T) T {
|
||||
var zero T
|
||||
for _, val := range vals {
|
||||
if val != zero {
|
||||
return val
|
||||
|
Loading…
Reference in New Issue
Block a user