Merge pull request #183 from redis-performance/fix.parse_infnan.plus.inf

Added missing FASTFLOAT_ALLOWS_LEADING_PLUS ifdef check in parse_infnan
This commit is contained in:
Daniel Lemire 2023-03-06 20:52:43 -05:00 committed by GitHub
commit eb8c001201
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -29,6 +29,11 @@ from_chars_result parse_infnan(const char *first, const char *last, T &value) n
minusSign = true; minusSign = true;
++first; ++first;
} }
#if FASTFLOAT_ALLOWS_LEADING_PLUS // disabled by default
if (*first == '+') {
++first;
}
#endif
if (last - first >= 3) { if (last - first >= 3) {
if (fastfloat_strncasecmp(first, "nan", 3)) { if (fastfloat_strncasecmp(first, "nan", 3)) {
answer.ptr = (first += 3); answer.ptr = (first += 3);