ruby-changes:3960
From: ko1@a...
Date: Wed, 13 Feb 2008 01:27:40 +0900 (JST)
Subject: [ruby-changes:3960] nobu - Ruby:r15450 (trunk): * parse.y (stmt, arg): concat opt_call_args only if non-null.
nobu 2008-02-13 01:27:22 +0900 (Wed, 13 Feb 2008) New Revision: 15450 Modified files: trunk/ChangeLog trunk/parse.y Log: * parse.y (stmt, arg): concat opt_call_args only if non-null. http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/parse.y?r1=15450&r2=15449&diff_format=u http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/ChangeLog?r1=15450&r2=15449&diff_format=u Index: ChangeLog =================================================================== --- ChangeLog (revision 15449) +++ ChangeLog (revision 15450) @@ -1,5 +1,7 @@ -Wed Feb 13 01:26:45 2008 Nobuyoshi Nakada <nobu@r...> +Wed Feb 13 01:27:20 2008 Nobuyoshi Nakada <nobu@r...> + * parse.y (stmt, arg): concat opt_call_args only if non-null. + * parse.y (arg_concat_gen, arg_append_gen): optimize for array concat. * parse.y (arg_add_gen): removed since identical to arg_append_gen. Index: parse.y =================================================================== --- parse.y (revision 15449) +++ parse.y (revision 15450) @@ -1027,11 +1027,10 @@ | primary_value '[' opt_call_args rbracket tOP_ASGN command_call { /*%%%*/ - NODE *args; + NODE *args = $6; - value_expr($6); - if (!$3) $3 = NEW_ZARRAY(); - args = arg_concat($6, $3); + value_expr(args); + if ($3) args = arg_concat(args, $3); if ($5 == tOROP) { $5 = 0; } @@ -1829,11 +1828,10 @@ | primary_value '[' opt_call_args rbracket tOP_ASGN arg { /*%%%*/ - NODE *args; + NODE *args = $6; - value_expr($6); - if (!$3) $3 = NEW_ZARRAY(); - args = arg_concat($6, $3); + value_expr(args); + if ($3) args = arg_concat(args, $3); if ($5 == tOROP) { $5 = 0; } -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/