mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-25 12:43:23 +00:00
pkg/selector: set the cap for slice in SelectorFromSet
This commit is contained in:
parent
89655584eb
commit
2b183943c2
@ -89,7 +89,7 @@ func try(selectorPiece, op string) (lhs, rhs string, ok bool) {
|
|||||||
|
|
||||||
// Given a Set, return a Selector which will match exactly that Set.
|
// Given a Set, return a Selector which will match exactly that Set.
|
||||||
func SelectorFromSet(ls Set) Selector {
|
func SelectorFromSet(ls Set) Selector {
|
||||||
var items []Selector
|
items := make([]Selector, 0, len(ls))
|
||||||
for label, value := range ls {
|
for label, value := range ls {
|
||||||
items = append(items, &hasTerm{label: label, value: value})
|
items = append(items, &hasTerm{label: label, value: value})
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user