Skip to content

Commit 1023227

Browse files
authored
Merge pull request #741 from nobu/ctype-plain-char
Avoid plain char for ctype macros
2 parents f3fb8a2 + 4431b36 commit 1023227

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

ext/json/ext/parser/parser.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ static VALUE rstring_cache_fetch(rvalue_cache *cache, const char *str, const lon
135135
return Qfalse;
136136
}
137137

138-
if (RB_UNLIKELY(!isalpha(str[0]))) {
138+
if (RB_UNLIKELY(!isalpha((unsigned char)str[0]))) {
139139
// Simple heuristic, if the first character isn't a letter,
140140
// we're much less likely to see this string again.
141141
// We mostly want to cache strings that are likely to be repeated.
@@ -187,7 +187,7 @@ static VALUE rsymbol_cache_fetch(rvalue_cache *cache, const char *str, const lon
187187
return Qfalse;
188188
}
189189

190-
if (RB_UNLIKELY(!isalpha(str[0]))) {
190+
if (RB_UNLIKELY(!isalpha((unsigned char)str[0]))) {
191191
// Simple heuristic, if the first character isn't a letter,
192192
// we're much less likely to see this string again.
193193
// We mostly want to cache strings that are likely to be repeated.

0 commit comments

Comments
 (0)