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

ruby-changes:40969

From: nobu <ko1@a...>
Date: Sat, 12 Dec 2015 16:08:03 +0900 (JST)
Subject: [ruby-changes:40969] nobu:r53048 (trunk): iseq.c: use rb_check_funcall

nobu	2015-12-12 16:07:42 +0900 (Sat, 12 Dec 2015)

  New Revision: 53048

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

  Log:
    iseq.c: use rb_check_funcall
    
    * iseq.c (rb_iseq_load_iseq): use rb_check_funcall instead of
      repeating method search.

  Modified files:
    trunk/iseq.c
Index: iseq.c
===================================================================
--- iseq.c	(revision 53047)
+++ iseq.c	(revision 53048)
@@ -479,11 +479,10 @@ rb_iseq_new_with_opt(NODE *node, VALUE n https://github.com/ruby/ruby/blob/trunk/iseq.c#L479
 const rb_iseq_t *
 rb_iseq_load_iseq(VALUE fname)
 {
-    if (rb_respond_to(rb_cISeq, rb_intern("load_iseq"))) {
-	VALUE iseqv = rb_funcall(rb_cISeq, rb_intern("load_iseq"), 1, fname);
-	if (CLASS_OF(iseqv) == rb_cISeq) {
-	    return  iseqw_check(iseqv);
-	}
+    VALUE iseqv = rb_check_funcall(rb_cISeq, rb_intern("load_iseq"), 1, &fname);
+
+    if (!SPECIAL_CONST_P(iseqv) && RBASIC_CLASS(iseqv) == rb_cISeq) {
+	return  iseqw_check(iseqv);
     }
 
     return NULL;

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

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