Commit f63f7728 authored by Ted Yu's avatar Ted Yu Committed by Ted Yu

Presize map with proper capacity in cache

parent 0bd35d1b
......@@ -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
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment