From 71bd4e811f5bd9069ec4af823b81a5d294ecd6e3 Mon Sep 17 00:00:00 2001 From: IRainman Date: Thu, 30 Apr 2026 15:39:27 +0300 Subject: [PATCH] cleanup. --- benchmarks/benchmark.cpp | 6 +++--- include/fast_float/digit_comparison.h | 3 +-- include/fast_float/float_common.h | 2 +- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/benchmarks/benchmark.cpp b/benchmarks/benchmark.cpp index c6d9016..86d7616 100644 --- a/benchmarks/benchmark.cpp +++ b/benchmarks/benchmark.cpp @@ -1,7 +1,7 @@ -// #define FASTFLOAT_ONLY_POSITIVE_C_NUMBER_WO_INF_NAN -// #define FASTFLOAT_ONLY_ROUNDS_TO_NEAREST_SUPPORTED -// #define FASTFLOAT_ISNOT_CHECKED_BOUNDS +#define FASTFLOAT_ONLY_POSITIVE_C_NUMBER_WO_INF_NAN +#define FASTFLOAT_ONLY_ROUNDS_TO_NEAREST_SUPPORTED +#define FASTFLOAT_ISNOT_CHECKED_BOUNDS #if defined(__linux__) || (__APPLE__ && __aarch64__) #define USING_COUNTERS diff --git a/include/fast_float/digit_comparison.h b/include/fast_float/digit_comparison.h index fd8c61d..a53ef54 100644 --- a/include/fast_float/digit_comparison.h +++ b/include/fast_float/digit_comparison.h @@ -1,7 +1,6 @@ #ifndef FASTFLOAT_DIGIT_COMPARISON_H #define FASTFLOAT_DIGIT_COMPARISON_H -#include #include #include #include @@ -107,7 +106,7 @@ fastfloat_really_inline FASTFLOAT_CONSTEXPR14 void round(adjusted_mantissa &am, if (-am.power2 >= mantissa_shift) { // have a denormal float am_pow_t shift = -am.power2 + 1; - cb(am, std::min(shift, 64)); + cb(am, (shift < 64 ? shift : 64)); // check for round-up: if rounding-nearest carried us to the hidden bit. am.power2 = (am.mantissa < (am_mant_t(1) << binary_format::mantissa_explicit_bits())) diff --git a/include/fast_float/float_common.h b/include/fast_float/float_common.h index b224e5c..a008b57 100644 --- a/include/fast_float/float_common.h +++ b/include/fast_float/float_common.h @@ -440,7 +440,7 @@ fastfloat_strncasecmp(UC const *actual_mixedcase, UC const *expected_lowercase, } uint_fast8_t sz = 8 / (sizeof(UC)); for (uint_fast8_t i = 0; i < length; i += sz) { - sz = std::min(sz, static_cast(length - i)); + sz = sz < (length - i) ? sz : length - i; std::memcpy(&val1, actual_mixedcase + i, sz * sizeof(UC)); std::memcpy(&val2, expected_lowercase + i, sz * sizeof(UC)); val1 |= mask;