Skip to content

Commit

Permalink
Compare in overflow-safe way
Browse files Browse the repository at this point in the history
  • Loading branch information
kgolab committed Aug 24, 2018
1 parent 6e9f520 commit 796b24f
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,8 @@ func (calc *UpdatePriorityCalculator) getUpdatePriority(pod *apiv1.Pod, recommen
if recommended.MilliValue() > request.MilliValue() {
scaleUp = true
}
if (hasLowerBound && request.MilliValue() < lowerBound.MilliValue()) ||
(hasUpperBound && request.MilliValue() > upperBound.MilliValue()) {
if (hasLowerBound && request.Cmp(lowerBound) < 0) ||
(hasUpperBound && request.Cmp(upperBound) > 0) {
outsideRecommendedRange = true
}
} else {
Expand Down

0 comments on commit 796b24f

Please sign in to comment.