Skip to content

Commit

Permalink
Merge pull request #3941 from bogo-y/usemax
Browse files Browse the repository at this point in the history
vs-scheduler: use max function to simplify code of capacity plugin
  • Loading branch information
volcano-sh-bot authored Dec 31, 2024
2 parents 0063f07 + 3ed4dd6 commit 5a7374d
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions pkg/scheduler/plugins/capacity/capacity.go
Original file line number Diff line number Diff line change
Expand Up @@ -697,10 +697,7 @@ func (cp *capacityPlugin) updateShare(attr *queueAttr) {
res := float64(0)

for _, rn := range attr.deserved.ResourceNames() {
share := helpers.Share(attr.allocated.Get(rn), attr.deserved.Get(rn))
if share > res {
res = share
}
res = max(res, helpers.Share(attr.allocated.Get(rn), attr.deserved.Get(rn)))
}

attr.share = res
Expand Down

0 comments on commit 5a7374d

Please sign in to comment.