Optimize the performance of the Clone method of preFilterState

This commit is contained in:
mantuliu 2023-05-05 19:53:12 +08:00
parent 7e25f1232a
commit e6900f5ead

View File

@ -93,8 +93,7 @@ func (s *preFilterState) Clone() framework.StateData {
copy.TpKeyToCriticalPaths[tpKey] = &criticalPaths{paths[0], paths[1]} copy.TpKeyToCriticalPaths[tpKey] = &criticalPaths{paths[0], paths[1]}
} }
for tpPair, matchNum := range s.TpPairToMatchNum { for tpPair, matchNum := range s.TpPairToMatchNum {
copyPair := topologyPair{key: tpPair.key, value: tpPair.value} copy.TpPairToMatchNum[tpPair] = matchNum
copy.TpPairToMatchNum[copyPair] = matchNum
} }
return &copy return &copy
} }