From 8e6e8e628888aa251f771ce8b3fe30a6b41a7a0e Mon Sep 17 00:00:00 2001 From: nobu Date: Thu, 29 Sep 2011 11:07:45 +0000 Subject: * use RB_TYPE_P which is optimized for constant types, instead of comparison with TYPE. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33357 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- proc.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'proc.c') diff --git a/proc.c b/proc.c index 68ea1d4b6d..8a19a88a2c 100644 --- a/proc.c +++ b/proc.c @@ -951,7 +951,7 @@ mnew(VALUE klass, VALUE obj, ID id, VALUE mclass, int scope) } rb_name_error(id, "method `%s' for %s `%s' is %s", rb_id2name(id), - (TYPE(klass) == T_MODULE) ? "module" : "class", + (RB_TYPE_P(klass, T_MODULE)) ? "module" : "class", rb_class2name(klass), v); } @@ -965,11 +965,11 @@ mnew(VALUE klass, VALUE obj, ID id, VALUE mclass, int scope) klass = me->klass; while (rclass != klass && - (FL_TEST(rclass, FL_SINGLETON) || TYPE(rclass) == T_ICLASS)) { + (FL_TEST(rclass, FL_SINGLETON) || RB_TYPE_P(rclass, T_ICLASS))) { rclass = RCLASS_SUPER(rclass); } - if (TYPE(klass) == T_ICLASS) { + if (RB_TYPE_P(klass, T_ICLASS)) { klass = RBASIC(klass)->klass; } -- cgit v1.2.3