Skip to content

Commit

Permalink
remove redundant parentheses
Browse files Browse the repository at this point in the history
  • Loading branch information
lucming committed Jun 29, 2022
1 parent d706e41 commit 40d45ae
Showing 1 changed file with 15 additions and 17 deletions.
32 changes: 15 additions & 17 deletions pkg/scheduler/plugins/predicates/predicates.go
Original file line number Diff line number Diff line change
Expand Up @@ -302,26 +302,24 @@ func (pp *predicatesPlugin) OnSessionOpen(ssn *framework.Session) {
}

// Check PredicateWithCache
{
var err error
var fit bool
if predicate.cacheEnable {
fit, err = pCache.PredicateWithCache(node.Name, task.Pod)
if err != nil {
fit, err = predicateByStablefilter(task.Pod, nodeInfo)
pCache.UpdateCache(node.Name, task.Pod, fit)
} else {
if !fit {
err = fmt.Errorf("plugin equivalence cache predicates failed")
}
}
} else {
var err error
var fit bool
if predicate.cacheEnable {
fit, err = pCache.PredicateWithCache(node.Name, task.Pod)
if err != nil {
fit, err = predicateByStablefilter(task.Pod, nodeInfo)
pCache.UpdateCache(node.Name, task.Pod, fit)
} else {
if !fit {
err = fmt.Errorf("plugin equivalence cache predicates failed")
}
}
} else {
fit, err = predicateByStablefilter(task.Pod, nodeInfo)
}

if !fit {
return err
}
if !fit {
return err
}

// Check NodePorts
Expand Down

0 comments on commit 40d45ae

Please sign in to comment.