Skip to content

Commit

Permalink
Improve the performance of map usage
Browse files Browse the repository at this point in the history
Signed-off-by: mantuliu <240951888@qq.com>
  • Loading branch information
sourcelliu committed Mar 21, 2023
1 parent c9ff286 commit 0567c93
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/controller/daemon/daemon_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -1371,7 +1371,7 @@ func failedPodsBackoffKey(ds *apps.DaemonSet, nodeName string) string {
// Returned pods can't be deleted by PodGCController so they should be deleted by DaemonSetController.
func getUnscheduledPodsWithoutNode(runningNodesList []*v1.Node, nodeToDaemonPods map[string][]*v1.Pod) []string {
var results []string
isNodeRunning := make(map[string]bool)
isNodeRunning := make(map[string]bool, len(runningNodesList))
for _, node := range runningNodesList {
isNodeRunning[node.Name] = true
}
Expand Down

0 comments on commit 0567c93

Please sign in to comment.