mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-20 18:31:15 +00:00
Merge pull request #116095 from sourcelliu/preemption
Improve the performance of method CandidatesToVictimsMap
This commit is contained in:
commit
e6522f8053
@ -127,7 +127,7 @@ func (pl *DefaultPreemption) GetOffsetAndNumCandidates(numNodes int32) (int32, i
|
|||||||
// This function is not applicable for out-of-tree preemption plugins that exercise
|
// This function is not applicable for out-of-tree preemption plugins that exercise
|
||||||
// different preemption candidates on the same nominated node.
|
// different preemption candidates on the same nominated node.
|
||||||
func (pl *DefaultPreemption) CandidatesToVictimsMap(candidates []preemption.Candidate) map[string]*extenderv1.Victims {
|
func (pl *DefaultPreemption) CandidatesToVictimsMap(candidates []preemption.Candidate) map[string]*extenderv1.Victims {
|
||||||
m := make(map[string]*extenderv1.Victims)
|
m := make(map[string]*extenderv1.Victims, len(candidates))
|
||||||
for _, c := range candidates {
|
for _, c := range candidates {
|
||||||
m[c.Name()] = c.Victims()
|
m[c.Name()] = c.Victims()
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user