mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
encoding.h: rb_enc_asciicompat_inline
* include/ruby/encoding.h (rb_enc_asciicompat): turn into an inline function to get rid of evalucating the argument twice. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53730 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
336fedc1ed
commit
383555fe44
1 changed files with 6 additions and 1 deletions
|
@ -232,7 +232,12 @@ int rb_enc_code_to_mbclen(int code, rb_encoding *enc);
|
|||
#define rb_enc_isspace(c,enc) ONIGENC_IS_CODE_SPACE((enc),(c))
|
||||
#define rb_enc_isdigit(c,enc) ONIGENC_IS_CODE_DIGIT((enc),(c))
|
||||
|
||||
#define rb_enc_asciicompat(enc) (rb_enc_mbminlen(enc)==1 && !rb_enc_dummy_p(enc))
|
||||
static inline int
|
||||
rb_enc_asciicompat_inline(rb_encoding *enc)
|
||||
{
|
||||
return rb_enc_mbminlen(enc)==1 && !rb_enc_dummy_p(enc);
|
||||
}
|
||||
#define rb_enc_asciicompat(enc) rb_enc_asciicompat_inline(enc)
|
||||
|
||||
int rb_enc_casefold(char *to, const char *p, const char *e, rb_encoding *enc);
|
||||
int rb_enc_toupper(int c, rb_encoding *enc);
|
||||
|
|
Loading…
Add table
Reference in a new issue