diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-04-29 03:48:26 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-04-29 03:48:26 +0000 |
commit | 810522e0ff0d0ccf891eebe75e1765baeef324de (patch) | |
tree | a125791dc177295dee89443903db6c1fa192b7ef /parse.y | |
parent | 69ba9302c5cc6a0edc2cd6e38ee233ac3b5df2d3 (diff) | |
download | ruby-810522e0ff0d0ccf891eebe75e1765baeef324de.tar.gz |
compile.c: move expansion of massign
* compile.c (iseq_compile_each): move expansion for massign to
variable of for-loop from the parser, to reduce method calls on
intermediate objects.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50398 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'parse.y')
-rw-r--r-- | parse.y | 20 |
1 files changed, 1 insertions, 19 deletions
@@ -2909,25 +2909,7 @@ primary : literal NODE *args, *scope; if (nd_type($2) == NODE_MASGN) { - /* if args.length == 1 && args[0].kind_of?(Array) - * args = args[0] - * end - */ - NODE *one = NEW_LIST(NEW_LIT(INT2FIX(1))); - NODE *zero = NEW_LIST(NEW_LIT(INT2FIX(0))); - m->nd_next = block_append( - NEW_IF( - NEW_NODE(NODE_AND, - NEW_CALL(NEW_CALL(NEW_DVAR(id), idLength, 0), - idEq, one), - NEW_CALL(NEW_CALL(NEW_DVAR(id), idAREF, zero), - rb_intern("kind_of?"), NEW_LIST(NEW_LIT(rb_cArray))), - 0), - NEW_DASGN_CURR(id, - NEW_CALL(NEW_DVAR(id), idAREF, zero)), - 0), - node_assign($2, NEW_DVAR(id))); - + m->nd_next = node_assign($2, NEW_FOR(NEW_DVAR(id), 0, 0)); args = new_args(m, 0, id, 0, new_args_tail(0, 0, 0)); } else { |