Skip to content

Commit

Permalink
issued:attempt to subtract with overflow (#20)
Browse files Browse the repository at this point in the history
  • Loading branch information
youngday authored Jun 6, 2024
1 parent 311d49f commit 4fa1ed5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/core/ops.rs
Original file line number Diff line number Diff line change
Expand Up @@ -226,5 +226,5 @@ pub fn descale_mask(mask: DynamicImage, w0: f32, h0: f32, w1: f32, h1: f32) -> D
}

pub fn make_divisible(x: usize, divisor: usize) -> usize {
(x - 1 + divisor) / divisor * divisor
(x + divisor - 1) / divisor * divisor
}

0 comments on commit 4fa1ed5

Please sign in to comment.