diff options
| author | Dion Dokter <diondokter@gmail.com> | 2024-06-11 13:24:35 +0200 |
|---|---|---|
| committer | Dion Dokter <diondokter@gmail.com> | 2024-06-11 13:24:35 +0200 |
| commit | c4391b326edbf4bcf374c9891fb0bfc2bc33531a (patch) | |
| tree | f454164b62645fb7538e1e266dc9f8335873d926 | |
| parent | 336e6ab3b396e1d1eb9b5a2f0bbc1744f4a68244 (diff) | |
| download | rust-c4391b326edbf4bcf374c9891fb0bfc2bc33531a.tar.gz rust-c4391b326edbf4bcf374c9891fb0bfc2bc33531a.zip | |
Skip fast path for dec2flt when optimize_for_size
| -rw-r--r-- | library/core/src/num/dec2flt/mod.rs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/library/core/src/num/dec2flt/mod.rs b/library/core/src/num/dec2flt/mod.rs index a4bc8b1c9b0..c10bf797b57 100644 --- a/library/core/src/num/dec2flt/mod.rs +++ b/library/core/src/num/dec2flt/mod.rs @@ -250,8 +250,10 @@ pub fn dec2flt<F: RawFloat>(s: &str) -> Result<F, ParseFloatError> { None => return Err(pfe_invalid()), }; num.negative = negative; - if let Some(value) = num.try_fast_path::<F>() { - return Ok(value); + if cfg!(not(feature = "optimize_for_size")) { + if let Some(value) = num.try_fast_path::<F>() { + return Ok(value); + } } // If significant digits were truncated, then we can have rounding error |
