code cleanup: scheduler simplify the check function in NodeLabel.Filter

This commit is contained in:
BinacsLee
2021-04-21 20:30:02 +08:00
parent 43a32c14f5
commit 9ff1419511

View File

@@ -99,7 +99,7 @@ func (pl *NodeLabel) Filter(ctx context.Context, _ *framework.CycleState, pod *v
check := func(labels []string, presence bool) bool {
for _, label := range labels {
exists := nodeLabels.Has(label)
if (exists && !presence) || (!exists && presence) {
if exists != presence {
return false
}
}