Skip to content

Commit

Permalink
Revert "* encoding.c (enc_find): simplified with RB_TYPE_P."
Browse files Browse the repository at this point in the history
This reverts commit r32817.
It has less code on the surface, but it needs more condition.
Moreover it doesn't need !.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32822 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
  • Loading branch information
nurse committed Aug 2, 2011
1 parent ae1bccf commit 7340796
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion encoding.c
Expand Up @@ -1054,7 +1054,7 @@ static VALUE
enc_find(VALUE klass, VALUE enc)
{
int idx;
if (!RB_TYPE_P(enc, T_DATA) && is_data_encoding(enc))
if (!SPECIAL_CONST_P(enc) && BUILTIN_TYPE(enc) == T_DATA && is_data_encoding(enc))
return enc;
idx = str_to_encindex(enc);
if (idx == UNSPECIFIED_ENCODING) return Qnil;
Expand Down

0 comments on commit 7340796

Please sign in to comment.