Skip to content

Commit

Permalink
Unrolled build for rust-lang#127122
Browse files Browse the repository at this point in the history
Rollup merge of rust-lang#127122 - TDecking:div_ceil, r=Nilstrieb

Remove uneccessary condition in `div_ceil`

Previously, `div_ceil` for unsigned integers had a `rhs > 0` for rounding. That condition however is always fulfilled, since `rhs == 0` would mean a division by zero earlier.
  • Loading branch information
rust-timer authored Jun 30, 2024
2 parents bf750f5 + 5dece2b commit e7d3431
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion library/core/src/num/uint_macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2726,7 +2726,7 @@ macro_rules! uint_impl {
pub const fn div_ceil(self, rhs: Self) -> Self {
let d = self / rhs;
let r = self % rhs;
if r > 0 && rhs > 0 {
if r > 0 {
d + 1
} else {
d
Expand Down

0 comments on commit e7d3431

Please sign in to comment.