Rollup merge of #103159 - cuviper:check_pow-final-try_opt, r=Mark-Simulacrum
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:
commit
e04bbcb9b1
2 changed files with 2 additions and 2 deletions
|
@ -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
|
||||
|
|
|
@ -990,7 +990,7 @@ macro_rules! uint_impl {
|
|||
// 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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue