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

Commit 48b7cc4

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

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
@@ -1094,8 +1094,8 @@ fn from_str_radix<T: FromStrRadixHelper>(src: &str, radix: u32) -> Result<T, Par
10941094

10951095
for &c in digits {
10961096
// When `radix` is passed in as a literal, rather than doing a slow `imul`
1097-
// then the compiler can use a shift if `radix` is a power of 2.
1098-
// (*10 can also be turned into *8 + *2).
1097+
// the compiler can use shifts if `radix` can be expressed as a
1098+
// sum of powers of 2 (x*10 can be written as x*8 + x*2).
10991099
// When the compiler can't use these optimisations,
11001100
// there is a latency of several cycles so doing the
11011101
// multiply before we need to use the result helps.

0 commit comments

Comments
 (0)