mirror of https://github.com/k3s-io/k3s
cache: Avoid reallocs in Index
parent
769230e735
commit
95a27394cc
|
@ -150,7 +150,7 @@ func (c *threadSafeMap) Index(indexName string, obj interface{}) ([]interface{},
|
|||
}
|
||||
}
|
||||
|
||||
list := []interface{}{}
|
||||
list := make([]interface{}, 0, returnKeySet.Len())
|
||||
for absoluteKey := range returnKeySet {
|
||||
list = append(list, c.items[absoluteKey])
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue