Commit 3fd730c5 authored by Clayton Coleman's avatar Clayton Coleman

Merge pull request #428 from claire921/selector

pkg/selector: set the cap for slice in SelectorFromSet
parents c2f55117 2b183943
...@@ -89,7 +89,7 @@ func try(selectorPiece, op string) (lhs, rhs string, ok bool) { ...@@ -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})
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment