1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* encoding.c (enc_find): simplified with RB_TYPE_P.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32817 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2011-08-02 14:50:54 +00:00
parent 48bc63fa7a
commit 048202f446

View file

@ -1054,7 +1054,7 @@ static VALUE
enc_find(VALUE klass, VALUE enc)
{
int idx;
if (!SPECIAL_CONST_P(enc) && BUILTIN_TYPE(enc) == T_DATA && is_data_encoding(enc))
if (!RB_TYPE_P(enc, T_DATA) && is_data_encoding(enc))
return enc;
idx = str_to_encindex(enc);
if (idx == UNSPECIFIED_ENCODING) return Qnil;