diff options
author | ktsj <ktsj@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2019-04-21 02:18:28 +0000 |
---|---|---|
committer | ktsj <ktsj@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2019-04-21 02:18:28 +0000 |
commit | eeee4f404b9e2dd9cac84de2b30f7bf1ba608c53 (patch) | |
tree | 871e0ac31dbb51c423d5675eb2de7589a7c55de5 /compile.c | |
parent | ecf4e8fbd7efe33e536bbef8d9e58b3c345dda48 (diff) | |
download | ruby-eeee4f404b9e2dd9cac84de2b30f7bf1ba608c53.tar.gz |
Remove unnecessary condition
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67653 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'compile.c')
-rw-r--r-- | compile.c | 10 |
1 files changed, 3 insertions, 7 deletions
@@ -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); |