Skip to content

Commit 71bd4e8

Browse files
committed
cleanup.
1 parent 482ce3b commit 71bd4e8

3 files changed

Lines changed: 5 additions & 6 deletions

File tree

benchmarks/benchmark.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

2-
// #define FASTFLOAT_ONLY_POSITIVE_C_NUMBER_WO_INF_NAN
3-
// #define FASTFLOAT_ONLY_ROUNDS_TO_NEAREST_SUPPORTED
4-
// #define FASTFLOAT_ISNOT_CHECKED_BOUNDS
2+
#define FASTFLOAT_ONLY_POSITIVE_C_NUMBER_WO_INF_NAN
3+
#define FASTFLOAT_ONLY_ROUNDS_TO_NEAREST_SUPPORTED
4+
#define FASTFLOAT_ISNOT_CHECKED_BOUNDS
55

66
#if defined(__linux__) || (__APPLE__ && __aarch64__)
77
#define USING_COUNTERS

include/fast_float/digit_comparison.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
#ifndef FASTFLOAT_DIGIT_COMPARISON_H
22
#define FASTFLOAT_DIGIT_COMPARISON_H
33

4-
#include <algorithm>
54
#include <cstdint>
65
#include <cstring>
76
#include <iterator>
@@ -107,7 +106,7 @@ fastfloat_really_inline FASTFLOAT_CONSTEXPR14 void round(adjusted_mantissa &am,
107106
if (-am.power2 >= mantissa_shift) {
108107
// have a denormal float
109108
am_pow_t shift = -am.power2 + 1;
110-
cb(am, std::min<am_pow_t>(shift, 64));
109+
cb(am, (shift < 64 ? shift : 64));
111110
// check for round-up: if rounding-nearest carried us to the hidden bit.
112111
am.power2 = (am.mantissa <
113112
(am_mant_t(1) << binary_format<T>::mantissa_explicit_bits()))

include/fast_float/float_common.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -440,7 +440,7 @@ fastfloat_strncasecmp(UC const *actual_mixedcase, UC const *expected_lowercase,
440440
}
441441
uint_fast8_t sz = 8 / (sizeof(UC));
442442
for (uint_fast8_t i = 0; i < length; i += sz) {
443-
sz = std::min(sz, static_cast<uint_fast8_t>(length - i));
443+
sz = sz < (length - i) ? sz : length - i;
444444
std::memcpy(&val1, actual_mixedcase + i, sz * sizeof(UC));
445445
std::memcpy(&val2, expected_lowercase + i, sz * sizeof(UC));
446446
val1 |= mask;

0 commit comments

Comments
 (0)