From 9a424bde1e93690630115d4272518c29e744ee27 Mon Sep 17 00:00:00 2001 From: Daniel Lemire Date: Mon, 9 Nov 2020 09:51:35 -0500 Subject: [PATCH] Reverting a microoptimization. --- include/fast_float/ascii_number.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/include/fast_float/ascii_number.h b/include/fast_float/ascii_number.h index 0338b22..e1e5be6 100644 --- a/include/fast_float/ascii_number.h +++ b/include/fast_float/ascii_number.h @@ -10,7 +10,9 @@ namespace fast_float { -fastfloat_really_inline bool is_integer(char c) noexcept { return (c & 0x30) == 0x30; } +// Next function can be micro-optimized to (c & 0x30) == 0x30, but compilers are entirely +// able to optimize c >= '0' && c <= '9' very well. +fastfloat_really_inline bool is_integer(char c) noexcept { return c >= '0' && c <= '9'; } // credit: https://johnnylee-sde.github.io/Fast-numeric-string-to-int/