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,9 +250,11 @@ pub fn dec2flt<F: RawFloat>(s: &str) -> Result<F, ParseFloatError> {
None => return Err(pfe_invalid()),
};
num.negative = negative;
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
// only if `mantissa + 1` produces a different result. We also avoid