Merge pull request #73727 from tedyu/master

Presize map with proper capacity in cache
pull/564/head
Kubernetes Prow Robot 2019-02-04 20:36:36 -08:00 committed by GitHub
commit 5ab509b54b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -108,12 +108,12 @@ func (cache *schedulerCache) Snapshot() *Snapshot {
cache.mu.RLock()
defer cache.mu.RUnlock()
nodes := make(map[string]*schedulernodeinfo.NodeInfo)
nodes := make(map[string]*schedulernodeinfo.NodeInfo, len(cache.nodes))
for k, v := range cache.nodes {
nodes[k] = v.Clone()
}
assumedPods := make(map[string]bool)
assumedPods := make(map[string]bool, len(cache.assumedPods))
for k, v := range cache.assumedPods {
assumedPods[k] = v
}