Compares two ASCII strings in a case insensitive manner.
| 213 | |
| 214 | // Compares two ASCII strings in a case insensitive manner. |
| 215 | inline bool fastfloat_strncasecmp(const char *input1, const char *input2, |
| 216 | size_t length) { |
| 217 | char running_diff{0}; |
| 218 | for (size_t i = 0; i < length; i++) { |
| 219 | running_diff |= (input1[i] ^ input2[i]); |
| 220 | } |
| 221 | return (running_diff == 0) || (running_diff == 32); |
| 222 | } |
| 223 | |
| 224 | #ifndef FLT_EVAL_METHOD |
| 225 | #error "FLT_EVAL_METHOD should be defined, please include cfloat." |