diff options
| author | Squirrel <gilescope@gmail.com> | 2021-05-18 18:22:21 +0100 |
|---|---|---|
| committer | gilescope <gilescope@gmail.com> | 2022-03-26 14:25:36 +0000 |
| commit | b9923a80c2e154f551a45385c16ce85d1d2534e2 (patch) | |
| tree | 51125d5ab16524ecf8f33730c1eef2e3d086a926 | |
| parent | 48b7cc49a373336d8e7ac8b1c9775abc5ea1eb6d (diff) | |
| download | rust-b9923a80c2e154f551a45385c16ce85d1d2534e2.tar.gz rust-b9923a80c2e154f551a45385c16ce85d1d2534e2.zip | |
Update library/core/src/num/mod.rs
Co-authored-by: LingMan <LingMan@users.noreply.github.com>
| -rw-r--r-- | library/core/src/num/mod.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/library/core/src/num/mod.rs b/library/core/src/num/mod.rs index a833f4025c2..9cd278e752c 100644 --- a/library/core/src/num/mod.rs +++ b/library/core/src/num/mod.rs @@ -1097,8 +1097,8 @@ fn from_str_radix<T: FromStrRadixHelper>(src: &str, radix: u32) -> Result<T, Par // the compiler can use shifts if `radix` can be expressed as a // sum of powers of 2 (x*10 can be written as x*8 + x*2). // When the compiler can't use these optimisations, - // there is a latency of several cycles so doing the - // multiply before we need to use the result helps. + // the latency of the multiplication can be hidden by issuing it + // before the result is needed. let mul = result.checked_mul(radix); let x = (c as char).to_digit(radix).ok_or(PIE { kind: InvalidDigit })?; result = mul.ok_or_else(overflow_err)?; |
