mirror of
				https://github.com/optim-enterprises-bv/kubernetes.git
				synced 2025-11-03 19:58:17 +00:00 
			
		
		
		
	Improve the performance of map usage
Signed-off-by: mantuliu <240951888@qq.com>
This commit is contained in:
		@@ -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.
 | 
					// 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 {
 | 
					func getUnscheduledPodsWithoutNode(runningNodesList []*v1.Node, nodeToDaemonPods map[string][]*v1.Pod) []string {
 | 
				
			||||||
	var results []string
 | 
						var results []string
 | 
				
			||||||
	isNodeRunning := make(map[string]bool)
 | 
						isNodeRunning := make(map[string]bool, len(runningNodesList))
 | 
				
			||||||
	for _, node := range runningNodesList {
 | 
						for _, node := range runningNodesList {
 | 
				
			||||||
		isNodeRunning[node.Name] = true
 | 
							isNodeRunning[node.Name] = true
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user