mirror of
https://github.com/coder/coder.git
synced 2025-07-15 22:20:27 +00:00
This reverts commit 8b125d6c5d
.
This commit is contained in:
@ -13,14 +13,9 @@ func takeFirstIP(values ...net.IPNet) net.IPNet {
|
||||
// takeFirstSlice implements takeFirst for []any.
|
||||
// []any is not a comparable type.
|
||||
func takeFirstSlice[T any](values ...[]T) []T {
|
||||
out := takeFirstF(values, func(v []T) bool {
|
||||
return takeFirstF(values, func(v []T) bool {
|
||||
return len(v) != 0
|
||||
})
|
||||
// Prevent nil slices
|
||||
if out == nil {
|
||||
return []T{}
|
||||
}
|
||||
return out
|
||||
}
|
||||
|
||||
// takeFirstF takes the first value that returns true
|
||||
|
Reference in New Issue
Block a user