sets.String is deprecated: use generic Set instead. new ways: s1 := Set[string]{} s2 := New[string]() (#9589)
Signed-off-by: Fish-pro <zechun.chen@daocloud.io>
This commit is contained in:
parent
1cdd61fb94
commit
ac8dd3dd53
8 changed files with 18 additions and 18 deletions
|
|
@ -37,13 +37,13 @@ type ObjectRefMap interface {
|
|||
|
||||
type objectRefMap struct {
|
||||
sync.Mutex
|
||||
v map[string]sets.String
|
||||
v map[string]sets.Set[string]
|
||||
}
|
||||
|
||||
// NewObjectRefMap returns a new ObjectRefMap.
|
||||
func NewObjectRefMap() ObjectRefMap {
|
||||
return &objectRefMap{
|
||||
v: make(map[string]sets.String),
|
||||
v: make(map[string]sets.Set[string]),
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -54,7 +54,7 @@ func (o *objectRefMap) Insert(consumer string, ref ...string) {
|
|||
|
||||
for _, r := range ref {
|
||||
if _, ok := o.v[r]; !ok {
|
||||
o.v[r] = sets.NewString(consumer)
|
||||
o.v[r] = sets.New[string](consumer)
|
||||
continue
|
||||
}
|
||||
o.v[r].Insert(consumer)
|
||||
|
|
@ -112,7 +112,7 @@ func (o *objectRefMap) Reference(ref string) []string {
|
|||
if !ok {
|
||||
return make([]string, 0)
|
||||
}
|
||||
return consumers.List()
|
||||
return consumers.UnsortedList()
|
||||
}
|
||||
|
||||
// ReferencedBy returns all objects referenced by the given object.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue