Replace std::min with ternary operators to avoid <algorithm> dependency#379
Replace std::min with ternary operators to avoid <algorithm> dependency#379lemire merged 2 commits intofastfloat:mainfrom
Conversation
`fastfloat_strncasecmp` relies on `std::min`.
|
Alternatively, maybe it's better to avoid |
|
Yes, |
|
Do you prefer just adding a Context: We'd like to roll to the latest fast_float version in Chrome and ideally avoid a downstream patch. |
|
I agree that the include should be avoided due to its large size. As for picking between a function or using the ternary operator (which is what I guess you mean by inlining the call?): I guess both are fine, but maybe the latter is preferable, given that std::min is scarcely used. But this is not a strong position. Grepping for |
|
@mlippautz Something like |
Replaces uses of std::min with ternary operators in ascii_number.h, digit_comparison.h, and float_common.h to remove the dependency on the <algorithm> header in those files.
Sorry, didn't see this comment until I now updated the PR. Shall we go with |
|
@mlippautz Ternary is fine. |
|
Running tests. I expect them to pass. |
|
The MINGW32 failure is unrelated. |
|
@lemire can you help with landing this? Also, could you cut a release for this as well? We set up auto rollers now for this repository. As long as things are compatible we will semi automatically get the latest changes. |
|
Yes, of course. |
fastfloat_strncasecmprelies onstd::min.