File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed
Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -901,6 +901,10 @@ fileprivate func fastParse64(
901901 firstSignificantDigitAfterDecimalPointOffset = i
902902 }
903903 if i < input. count {
904+ // Note: While testing `.description` + `Double(_:String)` against
905+ // random Double values to validate round-trip correctness, almost
906+ // 1/3 of `float_parse64()` is spent in the following loop.
907+
904908 // TODO: Evaluate SIMD or SWAR techniques here...
905909 // In the common case of input such as "1.794373235e+12",
906910 // we should be able to use `input.count - i` to estimate
@@ -959,7 +963,7 @@ fileprivate func fastParse64(
959963 byte = unsafe input[ unchecked: i]
960964 }
961965 // Did we scan more than 8 digits in the exponent?
962- if i - firstExponentDigitOffset > 8 {
966+ if i & - firstExponentDigitOffset > 8 {
963967 // If so, explicitExponent might have overflowed. Scan
964968 // again more carefully to correctly handle both
965969 // "1e0000000000000001" (== 10.0) and "1e99999999999999" (== inf)
You can’t perform that action at this time.
0 commit comments