Refactor parse_isalnum and parse_isxdigit to use macro

This commit is contained in:
ydah 2024-10-03 21:05:21 +09:00 committed by Yudai Takada
parent 500a87756f
commit 36b6625ba9
Notes: git 2025-01-08 17:34:07 +00:00

View File

@ -274,7 +274,7 @@ parse_isdigit(int c)
static inline int
parse_isalnum(int c)
{
return parse_isalpha(c) || parse_isdigit(c);
return ISALPHA(c) || ISDIGIT(c);
}
#undef ISALNUM
@ -283,7 +283,7 @@ parse_isalnum(int c)
static inline int
parse_isxdigit(int c)
{
return parse_isdigit(c) || ('A' <= c && c <= 'F') || ('a' <= c && c <= 'f');
return ISDIGIT(c) || ('A' <= c && c <= 'F') || ('a' <= c && c <= 'f');
}
#undef ISXDIGIT