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

ruby-changes:36078

From: nobu <ko1@a...>
Date: Mon, 27 Oct 2014 17:13:09 +0900 (JST)
Subject: [ruby-changes:36078] nobu:r48159 (trunk): proc.c: local variable

nobu	2014-10-27 17:12:52 +0900 (Mon, 27 Oct 2014)

  New Revision: 48159

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

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

  Modified files:
    trunk/proc.c
Index: proc.c
===================================================================
--- proc.c	(revision 48158)
+++ proc.c	(revision 48159)
@@ -2450,10 +2450,12 @@ proc_binding(VALUE self) https://github.com/ruby/ruby/blob/trunk/proc.c#L2450
     rb_proc_t *proc;
     VALUE bindval;
     rb_binding_t *bind;
+    rb_iseq_t *iseq;
 
     GetProcPtr(self, proc);
-    if (RB_TYPE_P((VALUE)proc->block.iseq, T_NODE)) {
-	if (!IS_METHOD_PROC_NODE((NODE *)proc->block.iseq)) {
+    iseq = proc->block.iseq;
+    if (RB_TYPE_P((VALUE)iseq, T_NODE)) {
+	if (!IS_METHOD_PROC_NODE((NODE *)iseq)) {
 	    rb_raise(rb_eArgError, "Can't create Binding from C level Proc");
 	}
     }
@@ -2462,9 +2464,9 @@ proc_binding(VALUE self) https://github.com/ruby/ruby/blob/trunk/proc.c#L2464
     GetBindingPtr(bindval, bind);
     bind->env = proc->envval;
     bind->blockprocval = proc->blockprocval;
-    if (RUBY_VM_NORMAL_ISEQ_P(proc->block.iseq)) {
-	bind->path = proc->block.iseq->location.path;
-	bind->first_lineno = FIX2INT(rb_iseq_first_lineno(proc->block.iseq->self));
+    if (RUBY_VM_NORMAL_ISEQ_P(iseq)) {
+	bind->path = iseq->location.path;
+	bind->first_lineno = FIX2INT(rb_iseq_first_lineno(iseq->self));
     }
     else {
 	bind->path = Qnil;

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

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