Skip to content

Commit

Permalink
Skip fast path for dec2flt when optimize_for_size
Browse files Browse the repository at this point in the history
  • Loading branch information
diondokter committed Jun 11, 2024
1 parent 336e6ab commit c4391b3
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions library/core/src/num/dec2flt/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit c4391b3

Please sign in to comment.