diff options
author | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-03-29 10:24:05 +0000 |
---|---|---|
committer | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-03-29 10:24:05 +0000 |
commit | 870b6da5c580979a1d22579877231e966c5976c7 (patch) | |
tree | 6010dba7a0ad1e3258092dbbc6bcffc1061cc2f0 /encoding.c | |
parent | fd6ea8291f23f8c505f42ceff369abdb2d60aaa2 (diff) | |
download | ruby-870b6da5c580979a1d22579877231e966c5976c7.tar.gz |
* include/ruby/ruby.h (rb_isupper, rb_islower, rb_isalpha, rb_isdigit,
rb_isalnum, rb_isxdigit, rb_isblank, rb_isspace, rb_isblank,
rb_iscntrl, rb_isprint, rb_ispunct, rb_isgraph,
rb_tolower, rb_toupper): use inline function to avoid function call.
* include/ruby/ruby.h (rb_isascii): use inline function to clarify
the logic.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54391 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'encoding.c')
-rw-r--r-- | encoding.c | 28 |
1 files changed, 0 insertions, 28 deletions
diff --git a/encoding.c b/encoding.c index ed710a9dfb..948b1781ac 100644 --- a/encoding.c +++ b/encoding.c @@ -1959,34 +1959,6 @@ Init_Encoding(void) /* locale insensitive ctype functions */ -#define ctype_test(c, ctype) \ - (rb_isascii(c) && ONIGENC_IS_ASCII_CODE_CTYPE((c), (ctype))) - -int rb_isalnum(int c) { return ctype_test(c, ONIGENC_CTYPE_ALNUM); } -int rb_isalpha(int c) { return ctype_test(c, ONIGENC_CTYPE_ALPHA); } -int rb_isblank(int c) { return ctype_test(c, ONIGENC_CTYPE_BLANK); } -int rb_iscntrl(int c) { return ctype_test(c, ONIGENC_CTYPE_CNTRL); } -int rb_isdigit(int c) { return ctype_test(c, ONIGENC_CTYPE_DIGIT); } -int rb_isgraph(int c) { return ctype_test(c, ONIGENC_CTYPE_GRAPH); } -int rb_islower(int c) { return ctype_test(c, ONIGENC_CTYPE_LOWER); } -int rb_isprint(int c) { return ctype_test(c, ONIGENC_CTYPE_PRINT); } -int rb_ispunct(int c) { return ctype_test(c, ONIGENC_CTYPE_PUNCT); } -int rb_isspace(int c) { return ctype_test(c, ONIGENC_CTYPE_SPACE); } -int rb_isupper(int c) { return ctype_test(c, ONIGENC_CTYPE_UPPER); } -int rb_isxdigit(int c) { return ctype_test(c, ONIGENC_CTYPE_XDIGIT); } - -int -rb_tolower(int c) -{ - return rb_isascii(c) ? ONIGENC_ASCII_CODE_TO_LOWER_CASE(c) : c; -} - -int -rb_toupper(int c) -{ - return rb_isascii(c) ? ONIGENC_ASCII_CODE_TO_UPPER_CASE(c) : c; -} - void rb_enc_foreach_name(int (*func)(st_data_t name, st_data_t idx, st_data_t arg), st_data_t arg) { |