[前][次][番号順一覧][スレッド一覧]

ruby-changes:30659

From: nobu <ko1@a...>
Date: Sat, 31 Aug 2013 13:30:44 +0900 (JST)
Subject: [ruby-changes:30659] nobu:r42738 (trunk): proc.c: local variable

nobu	2013-08-31 13:30:28 +0900 (Sat, 31 Aug 2013)

  New Revision: 42738

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=42738

  Log:
    proc.c: local variable
    
    * proc.c (umethod_bind): extract a local variable.

  Modified files:
    trunk/proc.c
Index: proc.c
===================================================================
--- proc.c	(revision 42737)
+++ proc.c	(revision 42738)
@@ -1918,18 +1918,20 @@ static VALUE https://github.com/ruby/ruby/blob/trunk/proc.c#L1918
 umethod_bind(VALUE method, VALUE recv)
 {
     struct METHOD *data, *bound;
+    VALUE methclass;
 
     TypedData_Get_Struct(method, struct METHOD, &method_data_type, data);
 
-    if (!RB_TYPE_P(data->rclass, T_MODULE) &&
-	data->rclass != CLASS_OF(recv) && !rb_obj_is_kind_of(recv, data->rclass)) {
-	if (FL_TEST(data->rclass, FL_SINGLETON)) {
+    methclass = data->rclass;
+    if (!RB_TYPE_P(methclass, T_MODULE) &&
+	methclass != CLASS_OF(recv) && !rb_obj_is_kind_of(recv, methclass)) {
+	if (FL_TEST(methclass, FL_SINGLETON)) {
 	    rb_raise(rb_eTypeError,
 		     "singleton method called for a different object");
 	}
 	else {
 	    rb_raise(rb_eTypeError, "bind argument must be an instance of %s",
-		     rb_class2name(data->rclass));
+		     rb_class2name(methclass));
 	}
     }
 

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]