We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 41b5c75 commit 80e3d8aCopy full SHA for 80e3d8a
src/compute.rs
@@ -34,7 +34,7 @@ fn parse_float(bytes: &[u8]) -> i32 {
34
let neg = (bytes[0] == b'-') as usize;
35
let sgn = 1 - 2 * neg as i32;
36
let res = bytes.iter().skip(neg).fold(0, |acc, &byte| {
37
- let is_digit = (b'0' <= byte && byte <= b'9') as i32;
+ let is_digit = byte.is_ascii_digit() as i32;
38
let digit = (byte as i32).wrapping_sub(b'0' as i32);
39
acc * (10 * is_digit + (1 - is_digit)) + digit * is_digit
40
});
0 commit comments