diff options
-rw-r--r-- | ChangeLog | 4 | ||||
-rw-r--r-- | parse.y | 14 |
2 files changed, 9 insertions, 9 deletions
@@ -1,4 +1,6 @@ -Wed Feb 13 01:26:45 2008 Nobuyoshi Nakada <nobu@ruby-lang.org> +Wed Feb 13 01:27:20 2008 Nobuyoshi Nakada <nobu@ruby-lang.org> + + * parse.y (stmt, arg): concat opt_call_args only if non-null. * parse.y (arg_concat_gen, arg_append_gen): optimize for array concat. @@ -1027,11 +1027,10 @@ stmt : keyword_alias fitem {lex_state = EXPR_FNAME;} fitem | 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 @@ arg : lhs '=' arg | 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; } |