diff --git a/src/common.h b/src/common.h index 2b81dfbce..04775df06 100644 --- a/src/common.h +++ b/src/common.h @@ -699,4 +699,12 @@ const T *get_by_sorted_name(const wcstring &name, const T (&vals)[N]) { return get_by_sorted_name(name.c_str(), vals); } +/// As established in 1ab81ab90d1a408702e11f081fdaaafa30636c31, iswdigit() is very slow under glibc, +/// and does nothing more than establish whether or not the single specified character is in the +/// range ('0','9'). +__attribute__((always_inline)) +bool inline iswdigit(const wchar_t c) { + return c >= L'0' && c <= L'9'; +} + #endif // FISH_COMMON_H