Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit b9923a8

Browse files
gilescopeLingMan
andcommitted
Update library/core/src/num/mod.rs
Co-authored-by: LingMan <[email protected]>
1 parent 48b7cc4 commit b9923a8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

library/core/src/num/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1097,8 +1097,8 @@ fn from_str_radix<T: FromStrRadixHelper>(src: &str, radix: u32) -> Result<T, Par
10971097
// the compiler can use shifts if `radix` can be expressed as a
10981098
// sum of powers of 2 (x*10 can be written as x*8 + x*2).
10991099
// When the compiler can't use these optimisations,
1100-
// there is a latency of several cycles so doing the
1101-
// multiply before we need to use the result helps.
1100+
// the latency of the multiplication can be hidden by issuing it
1101+
// before the result is needed.
11021102
let mul = result.checked_mul(radix);
11031103
let x = (c as char).to_digit(radix).ok_or(PIE { kind: InvalidDigit })?;
11041104
result = mul.ok_or_else(overflow_err)?;

0 commit comments

Comments
 (0)