1
Fork 0

Remove the redundant Some(try_opt!(..)) in checked_pow

The final return value doesn't need to be tried at all -- we can just
return the checked option directly. The optimizer can probably figure
this out anyway, but there's no need to make it work here.
This commit is contained in:
Josh Stone 2022-10-17 11:21:50 -07:00
parent a9d1cafa87
commit d7fd1d57ec
2 changed files with 2 additions and 2 deletions

View file

@ -869,7 +869,7 @@ macro_rules! int_impl {
// Deal with the final bit of the exponent separately, since
// squaring the base afterwards is not necessary and may cause a
// needless overflow.
Some(try_opt!(acc.checked_mul(base)))
acc.checked_mul(base)
}
/// Saturating integer addition. Computes `self + rhs`, saturating at the numeric