mirror of
https://github.com/kubernetes/client-go.git
synced 2025-07-31 23:00:26 +00:00
Avoid allocations in ByIndex() function
Kubernetes-commit: 7d46e27db185e5281b718ad964e9c2f8777c2fc8
This commit is contained in:
parent
ad771aa269
commit
49804083df
2
tools/cache/thread_safe_store.go
vendored
2
tools/cache/thread_safe_store.go
vendored
@ -185,7 +185,7 @@ func (c *threadSafeMap) ByIndex(indexName, indexKey string) ([]interface{}, erro
|
||||
|
||||
set := index[indexKey]
|
||||
list := make([]interface{}, 0, set.Len())
|
||||
for _, key := range set.List() {
|
||||
for key := range set {
|
||||
list = append(list, c.items[key])
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user