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

ruby-changes:55441

From: ktsj <ko1@a...>
Date: Sun, 21 Apr 2019 11:18:33 +0900 (JST)
Subject: [ruby-changes:55441] ktsj:r67653 (trunk): Remove unnecessary condition

ktsj	2019-04-21 11:18:28 +0900 (Sun, 21 Apr 2019)

  New Revision: 67653

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

  Log:
    Remove unnecessary condition

  Modified files:
    trunk/compile.c
Index: compile.c
===================================================================
--- compile.c	(revision 67652)
+++ compile.c	(revision 67653)
@@ -5284,9 +5284,7 @@ iseq_compile_pattern_each(rb_iseq_t *ise https://github.com/ruby/ruby/blob/trunk/compile.c#L5284
          *   end
          *   pattern.post_args_num.each do |i|
          *     j = pattern.pre_args_num + i
-         *     if pattern.use_rest_num?
-         *       j += rest_num
-         *     end
+         *     j += rest_num
          *     unless pattern.post_args[i].match?(d[j])
          *       goto match_failed
          *     end
@@ -5384,10 +5382,8 @@ iseq_compile_pattern_each(rb_iseq_t *ise https://github.com/ruby/ruby/blob/trunk/compile.c#L5382
             ADD_INSN(ret, line, dup);
 
             ADD_INSN1(ret, line, putobject, INT2FIX(pre_args_num + i));
-            if (use_rest_num) {
-                ADD_INSN1(ret, line, topn, INT2FIX(3));
-                ADD_SEND(ret, line, idPLUS, INT2FIX(1));
-            }
+            ADD_INSN1(ret, line, topn, INT2FIX(3));
+            ADD_SEND(ret, line, idPLUS, INT2FIX(1));
 
             ADD_SEND(ret, line, idAREF, INT2FIX(1));
             iseq_compile_pattern_each(iseq, ret, args->nd_head, in_alt_pattern);

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

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