Skip to content

Commit 58eb09d

Browse files
committed
update function name
1 parent 3ca2218 commit 58eb09d

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

libc/src/__support/ctype_utils.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -580,8 +580,8 @@ LIBC_INLINE static constexpr bool isgraph(char ch) {
580580

581581
// An overload which provides a way to compare input with specific character
582582
// values, when input can be of a regular or a wide character type.
583-
LIBC_INLINE static constexpr bool is_one_of(char ch, char c_value,
584-
[[maybe_unused]] wchar_t) {
583+
LIBC_INLINE static constexpr bool is_char_or_wchar(char ch, char c_value,
584+
[[maybe_unused]] wchar_t) {
585585
return (ch == c_value);
586586
}
587587

libc/src/__support/str_to_integer.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,9 @@ first_non_whitespace(const CharType *__restrict src,
4646
// plus sign, minus sign, or neither.
4747
template <typename CharType>
4848
LIBC_INLINE static int get_sign(const CharType *__restrict src) {
49-
if (is_one_of(src[0], '+', L'+'))
49+
if (is_char_or_wchar(src[0], '+', L'+'))
5050
return 1;
51-
if (is_one_of(src[0], '-', L'-'))
51+
if (is_char_or_wchar(src[0], '-', L'-'))
5252
return -1;
5353
return 0;
5454
}
@@ -60,8 +60,8 @@ LIBC_INLINE static bool is_hex_start(const CharType *__restrict src,
6060
size_t src_len) {
6161
if (src_len < 3)
6262
return false;
63-
return is_one_of(src[0], '0', L'0') &&
64-
is_one_of(tolower(src[1]), 'x', L'x') && isalnum(src[2]) &&
63+
return is_char_or_wchar(src[0], '0', L'0') &&
64+
is_char_or_wchar(tolower(src[1]), 'x', L'x') && isalnum(src[2]) &&
6565
b36_char_to_int(src[2]) < 16;
6666
}
6767

@@ -78,7 +78,7 @@ LIBC_INLINE static int infer_base(const CharType *__restrict src,
7878
// An octal number is defined as "the prefix 0 optionally followed by a
7979
// sequence of the digits 0 through 7 only" (C standard 6.4.4.1) and so any
8080
// number that starts with 0, including just 0, is an octal number.
81-
if (src_len > 0 && internal::is_one_of(src[0], '0', L'0')) {
81+
if (src_len > 0 && is_char_or_wchar(src[0], '0', L'0')) {
8282
return 8;
8383
}
8484
// A decimal number is defined as beginning "with a nonzero digit and

libc/src/__support/wctype_utils.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -579,8 +579,8 @@ LIBC_INLINE static constexpr bool isspace(wchar_t wch) {
579579

580580
// An overload which provides a way to compare input with specific character
581581
// values, when input can be of a regular or a wide character type.
582-
LIBC_INLINE static constexpr bool is_one_of(wchar_t ch, [[maybe_unused]] char,
583-
wchar_t wc_value) {
582+
LIBC_INLINE static constexpr bool
583+
is_char_or_wchar(wchar_t ch, [[maybe_unused]] char, wchar_t wc_value) {
584584
return (ch == wc_value);
585585
}
586586

0 commit comments

Comments
 (0)