From e6900f5ead7902546166da59dc38bbd528c1ffde Mon Sep 17 00:00:00 2001 From: mantuliu <240951888@qq.com> Date: Fri, 5 May 2023 19:53:12 +0800 Subject: [PATCH] Optimize the performance of the Clone method of preFilterState --- pkg/scheduler/framework/plugins/podtopologyspread/filtering.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pkg/scheduler/framework/plugins/podtopologyspread/filtering.go b/pkg/scheduler/framework/plugins/podtopologyspread/filtering.go index a3b11b9fd4c..788e64ae239 100644 --- a/pkg/scheduler/framework/plugins/podtopologyspread/filtering.go +++ b/pkg/scheduler/framework/plugins/podtopologyspread/filtering.go @@ -93,8 +93,7 @@ func (s *preFilterState) Clone() framework.StateData { copy.TpKeyToCriticalPaths[tpKey] = &criticalPaths{paths[0], paths[1]} } for tpPair, matchNum := range s.TpPairToMatchNum { - copyPair := topologyPair{key: tpPair.key, value: tpPair.value} - copy.TpPairToMatchNum[copyPair] = matchNum + copy.TpPairToMatchNum[tpPair] = matchNum } return © }