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

ruby-changes:25345

From: nobu <ko1@a...>
Date: Thu, 1 Nov 2012 13:17:12 +0900 (JST)
Subject: [ruby-changes:25345] nobu:r37397 (trunk): iseq.c: simplify

nobu	2012-11-01 13:17:01 +0900 (Thu, 01 Nov 2012)

  New Revision: 37397

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

  Log:
    iseq.c: simplify
    
    * iseq.c (set_relation): simplify and merge same conditions.

  Modified files:
    trunk/iseq.c

Index: iseq.c
===================================================================
--- iseq.c	(revision 37396)
+++ iseq.c	(revision 37397)
@@ -213,30 +213,18 @@
 	    cref->nd_next = iseq->cref_stack;
 	    iseq->cref_stack = cref;
 	}
+	iseq->local_iseq = iseq;
     }
     else if (type == ISEQ_TYPE_METHOD || type == ISEQ_TYPE_CLASS) {
 	iseq->cref_stack = NEW_CREF(0); /* place holder */
 	iseq->cref_stack->nd_refinements = Qnil;
-    }
-    else if (RTEST(parent)) {
-	rb_iseq_t *piseq;
-	GetISeqPtr(parent, piseq);
-	iseq->cref_stack = piseq->cref_stack;
-    }
-
-    if (type == ISEQ_TYPE_TOP ||
-	type == ISEQ_TYPE_METHOD || type == ISEQ_TYPE_CLASS) {
 	iseq->local_iseq = iseq;
     }
     else if (RTEST(parent)) {
 	rb_iseq_t *piseq;
 	GetISeqPtr(parent, piseq);
+	iseq->cref_stack = piseq->cref_stack;
 	iseq->local_iseq = piseq->local_iseq;
-    }
-
-    if (RTEST(parent)) {
-	rb_iseq_t *piseq;
-	GetISeqPtr(parent, piseq);
 	iseq->parent_iseq = piseq;
     }
 }

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

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