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

ruby-changes:28967

From: nobu <ko1@a...>
Date: Sat, 1 Jun 2013 17:21:47 +0900 (JST)
Subject: [ruby-changes:28967] nobu:r41019 (trunk): vm_insnhelper.c: add comments

nobu	2013-06-01 17:21:37 +0900 (Sat, 01 Jun 2013)

  New Revision: 41019

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

  Log:
    vm_insnhelper.c: add comments
    
    * vm_insnhelper.c (vm_yield_setup_block_args): break a long line and
      add comments.  remove useless code.

  Modified files:
    trunk/vm_insnhelper.c

Index: vm_insnhelper.c
===================================================================
--- vm_insnhelper.c	(revision 41018)
+++ vm_insnhelper.c	(revision 41019)
@@ -2205,7 +2205,9 @@ vm_yield_setup_block_args(rb_thread_t *t https://github.com/ruby/ruby/blob/trunk/vm_insnhelper.c#L2205
      */
     arg0 = argv[0];
     if (!(iseq->arg_simple & 0x02) &&                           /* exclude {|a|} */
-	((m + iseq->arg_post_len) > 0 || iseq->arg_opts > 2) &&        /* this process is meaningful */
+	((m + iseq->arg_post_len) > 0 ||			/* positional arguments exist */
+	 iseq->arg_opts > 2 ||					/* multiple optional arguments exist */
+	 0) &&
 	argc == 1 && !NIL_P(ary = rb_check_array_type(arg0))) { /* rhs is only an array */
 	th->mark_stack_len = argc = RARRAY_LENINT(ary);
 
@@ -2213,9 +2215,6 @@ vm_yield_setup_block_args(rb_thread_t *t https://github.com/ruby/ruby/blob/trunk/vm_insnhelper.c#L2215
 
 	MEMCPY(argv, RARRAY_PTR(ary), VALUE, argc);
     }
-    else {
-	argv[0] = arg0;
-    }
 
     for (i=argc; i<m; i++) {
 	argv[i] = Qnil;

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

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