Skip to content

Commit

Permalink
Check that min <= max in clamp_finite
Browse files Browse the repository at this point in the history
  • Loading branch information
jedel1043 committed Feb 27, 2024
1 parent 01baec0 commit db34363
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions core/engine/src/value/integer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ impl IntegerOrInfinity {
/// Panics if `min > max`.
#[must_use]
pub fn clamp_finite(self, min: i64, max: i64) -> i64 {
assert!(min <= max);
match self {
Self::Integer(i) => i.clamp(min, max),
Self::PositiveInfinity => max,
Expand Down

0 comments on commit db34363

Please sign in to comment.