mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-05 10:19:50 +00:00
cache: Avoid reallocs in Index
This commit is contained in:
parent
769230e735
commit
95a27394cc
2
pkg/client/cache/thread_safe_store.go
vendored
2
pkg/client/cache/thread_safe_store.go
vendored
@ -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 {
|
for absoluteKey := range returnKeySet {
|
||||||
list = append(list, c.items[absoluteKey])
|
list = append(list, c.items[absoluteKey])
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user