Skip to content

Commit cc46411

Browse files
committed
Use adaptive set in label value index.
1 parent 89402b5 commit cc46411

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

felix/labelindex/labelnamevalueindex/label_name_value_index.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ func New[ItemID comparable, Item Labeled](nameOfTrackedItems string) *LabelNameV
5353
}
5454

5555
type values[ItemID comparable] struct {
56-
m map[string]set.Set[ItemID]
56+
m map[string]*set.Adaptive[ItemID]
5757
count int
5858
}
5959

@@ -75,13 +75,13 @@ func (idx *LabelNameValueIndex[ItemID, Item]) Add(id ItemID, item Item) {
7575
vals, ok := idx.labelNameToValueToIDs[k]
7676
if !ok {
7777
vals = values[ItemID]{
78-
m: map[string]set.Set[ItemID]{},
78+
m: map[string]*set.Adaptive[ItemID]{},
7979
}
8080
idx.labelNameToValueToIDs[k] = vals
8181
}
8282
setOfIDs := vals.m[v]
8383
if setOfIDs == nil {
84-
setOfIDs = set.New[ItemID]()
84+
setOfIDs = set.NewAdaptive[ItemID]()
8585
vals.m[v] = setOfIDs
8686
}
8787
setOfIDs.Add(id)

0 commit comments

Comments
 (0)