1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* parse.y (literal_concat_gen): reduced unnecessary node at string

literal concatenation with empty head dstr.  [ruby-dev:38968]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24333 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2009-07-31 01:54:14 +00:00
parent 3129ed327e
commit 5004e33f8d
2 changed files with 12 additions and 1 deletions

View file

@ -1,3 +1,8 @@
Fri Jul 31 10:54:08 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
* parse.y (literal_concat_gen): reduced unnecessary node at string
literal concatenation with empty head dstr. [ruby-dev:38968]
Fri Jul 31 02:57:39 2009 Yusuke Endoh <mame@tsg.ne.jp> Fri Jul 31 02:57:39 2009 Yusuke Endoh <mame@tsg.ne.jp>
* parse.y (literal_concat_gen): NODE_DSTR was incorrectly handled as * parse.y (literal_concat_gen): NODE_DSTR was incorrectly handled as

View file

@ -7832,8 +7832,14 @@ literal_concat_gen(struct parser_params *parser, NODE *head, NODE *tail)
rb_gc_force_recycle((VALUE)head); rb_gc_force_recycle((VALUE)head);
head = tail; head = tail;
} }
else if (NIL_P(tail->nd_lit)) {
list_concat(head, tail->nd_next);
rb_gc_force_recycle((VALUE)tail);
}
else { else {
list_concat(head, NEW_ARRAY(tail)); nd_set_type(tail, NODE_ARRAY);
tail->nd_head = NEW_STR(tail->nd_lit);
list_concat(head, tail);
} }
break; break;