From eeee4f404b9e2dd9cac84de2b30f7bf1ba608c53 Mon Sep 17 00:00:00 2001 From: ktsj Date: Sun, 21 Apr 2019 02:18:28 +0000 Subject: [PATCH] Remove unnecessary condition git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67653 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- compile.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/compile.c b/compile.c index 2dbfb5497e..f4bc4817d0 100644 --- a/compile.c +++ b/compile.c @@ -5284,9 +5284,7 @@ iseq_compile_pattern_each(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *c * 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 *iseq, LINK_ANCHOR *const ret, const NODE *c 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);