ruby-changes:20774
From: naruse <ko1@a...>
Date: Wed, 3 Aug 2011 07:39:38 +0900 (JST)
Subject: [ruby-changes:20774] naruse:r32822 (trunk): Revert "* encoding.c (enc_find): simplified with RB_TYPE_P."
naruse 2011-08-03 07:39:28 +0900 (Wed, 03 Aug 2011) New Revision: 32822 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=32822 Log: Revert "* encoding.c (enc_find): simplified with RB_TYPE_P." This reverts commit r32817. It has less code on the surface, but it needs more condition. Moreover it doesn't need !. Modified files: trunk/encoding.c Index: encoding.c =================================================================== --- encoding.c (revision 32821) +++ encoding.c (revision 32822) @@ -1054,7 +1054,7 @@ 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; -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/