mirror of
https://github.com/kubernetes/client-go.git
synced 2025-08-30 13:23:28 +00:00
Merge pull request #75730 from wojtek-t/minor_perf_improvements
Avoid allocations in ByIndex() function Kubernetes-commit: feb9bb151c6a52cf408d5f9fab0bc49b8ea886fc
This commit is contained in:
commit
35ae057ca1
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