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

ruby-changes:32090

From: nobu <ko1@a...>
Date: Fri, 13 Dec 2013 12:53:26 +0900 (JST)
Subject: [ruby-changes:32090] nobu:r44169 (trunk): eval.c: clear cache

nobu	2013-12-13 12:53:20 +0900 (Fri, 13 Dec 2013)

  New Revision: 44169

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

  Log:
    eval.c: clear cache
    
    * eval.c (rb_using_module): clear method cache after applying
      refinements.
    
    * eval.c (mod_using, top_using): remove redundant type checks.

  Modified files:
    trunk/eval.c
Index: eval.c
===================================================================
--- eval.c	(revision 44168)
+++ eval.c	(revision 44169)
@@ -1176,6 +1176,7 @@ rb_using_module(NODE *cref, VALUE module https://github.com/ruby/ruby/blob/trunk/eval.c#L1176
 {
     Check_Type(module, T_MODULE);
     using_module_recursive(cref, module);
+    rb_clear_method_cache_by_class(rb_cObject);
 }
 
 VALUE
@@ -1295,9 +1296,7 @@ mod_using(VALUE self, VALUE module) https://github.com/ruby/ruby/blob/trunk/eval.c#L1296
     if (prev_cfp && prev_cfp->self != self) {
 	rb_raise(rb_eRuntimeError, "Module#using is not called on self");
     }
-    Check_Type(module, T_MODULE);
     rb_using_module(cref, module);
-    rb_clear_method_cache_by_class(rb_cObject);
     return self;
 }
 
@@ -1431,9 +1430,7 @@ top_using(VALUE self, VALUE module) https://github.com/ruby/ruby/blob/trunk/eval.c#L1430
 	rb_raise(rb_eRuntimeError,
 		 "main.using is permitted only at toplevel");
     }
-    Check_Type(module, T_MODULE);
     rb_using_module(cref, module);
-    rb_clear_method_cache_by_class(rb_cObject);
     return self;
 }
 

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

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