mirror of
https://github.com/ceph/ceph-csi.git
synced 2025-06-13 10:33:35 +00:00
rebase: update kubernetes to 1.30
updating kubernetes to 1.30 release Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
This commit is contained in:
committed by
mergify[bot]
parent
62ddcf715b
commit
e727bd351e
9
vendor/k8s.io/apimachinery/pkg/util/sets/set.go
generated
vendored
9
vendor/k8s.io/apimachinery/pkg/util/sets/set.go
generated
vendored
@ -17,6 +17,7 @@ limitations under the License.
|
||||
package sets
|
||||
|
||||
import (
|
||||
"cmp"
|
||||
"sort"
|
||||
)
|
||||
|
||||
@ -37,7 +38,7 @@ func New[T comparable](items ...T) Set[T] {
|
||||
// KeySet creates a Set from a keys of a map[comparable](? extends interface{}).
|
||||
// If the value passed in is not actually a map, this will panic.
|
||||
func KeySet[T comparable, V any](theMap map[T]V) Set[T] {
|
||||
ret := Set[T]{}
|
||||
ret := make(Set[T], len(theMap))
|
||||
for keyValue := range theMap {
|
||||
ret.Insert(keyValue)
|
||||
}
|
||||
@ -193,7 +194,7 @@ func (s1 Set[T]) Equal(s2 Set[T]) bool {
|
||||
return len(s1) == len(s2) && s1.IsSuperset(s2)
|
||||
}
|
||||
|
||||
type sortableSliceOfGeneric[T ordered] []T
|
||||
type sortableSliceOfGeneric[T cmp.Ordered] []T
|
||||
|
||||
func (g sortableSliceOfGeneric[T]) Len() int { return len(g) }
|
||||
func (g sortableSliceOfGeneric[T]) Less(i, j int) bool { return less[T](g[i], g[j]) }
|
||||
@ -203,7 +204,7 @@ func (g sortableSliceOfGeneric[T]) Swap(i, j int) { g[i], g[j] = g[j], g[i]
|
||||
//
|
||||
// This is a separate function and not a method because not all types supported
|
||||
// by Generic are ordered and only those can be sorted.
|
||||
func List[T ordered](s Set[T]) []T {
|
||||
func List[T cmp.Ordered](s Set[T]) []T {
|
||||
res := make(sortableSliceOfGeneric[T], 0, len(s))
|
||||
for key := range s {
|
||||
res = append(res, key)
|
||||
@ -236,6 +237,6 @@ func (s Set[T]) Len() int {
|
||||
return len(s)
|
||||
}
|
||||
|
||||
func less[T ordered](lhs, rhs T) bool {
|
||||
func less[T cmp.Ordered](lhs, rhs T) bool {
|
||||
return lhs < rhs
|
||||
}
|
||||
|
Reference in New Issue
Block a user