simplify code in topologymanager

This commit is contained in:
Wenfeng-GAO 2020-03-28 00:04:51 +08:00
parent 3842a92f5f
commit 1aebbee7da
2 changed files with 2 additions and 8 deletions

View File

@ -35,10 +35,7 @@ func (p *restrictedPolicy) Name() string {
}
func (p *restrictedPolicy) canAdmitPodResult(hint *TopologyHint) bool {
if !hint.Preferred {
return false
}
return true
return hint.Preferred
}
func (p *restrictedPolicy) Merge(providersHints []map[string][]TopologyHint) (TopologyHint, bool) {

View File

@ -40,10 +40,7 @@ func (p *singleNumaNodePolicy) Name() string {
}
func (p *singleNumaNodePolicy) canAdmitPodResult(hint *TopologyHint) bool {
if !hint.Preferred {
return false
}
return true
return hint.Preferred
}
// Return hints that have valid bitmasks with exactly one bit set.