Merge pull request #117803 from sourcelliu/preFilterState

Optimize the performance of the Clone method of preFilterState
This commit is contained in:
Kubernetes Prow Robot 2024-01-19 10:57:20 +01:00 committed by GitHub
commit c6887b1c00
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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 &copy
}