Skip fast path for dec2flt when optimize_for_size

This commit is contained in:
Dion Dokter 2024-06-11 13:24:35 +02:00
parent 336e6ab3b3
commit c4391b326e

View File

@ -250,8 +250,10 @@ pub fn dec2flt<F: RawFloat>(s: &str) -> Result<F, ParseFloatError> {
None => return Err(pfe_invalid()), None => return Err(pfe_invalid()),
}; };
num.negative = negative; num.negative = negative;
if let Some(value) = num.try_fast_path::<F>() { if cfg!(not(feature = "optimize_for_size")) {
return Ok(value); if let Some(value) = num.try_fast_path::<F>() {
return Ok(value);
}
} }
// If significant digits were truncated, then we can have rounding error // If significant digits were truncated, then we can have rounding error