Skip to content

Commit

Permalink
reduced unnecessary node at string literal concatenation with empty h…
Browse files Browse the repository at this point in the history
…ead dstr
  • Loading branch information
Watson1978 committed Jan 14, 2012
1 parent 6a033db commit 71770e5
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions parse.y
Expand Up @@ -7788,6 +7788,9 @@ literal_concat_gen(struct parser_params *parser, NODE *head, NODE *tail)
rb_gc_force_recycle((VALUE)head);
head = tail;
}
else if (NIL_P(tail->nd_lit)) {
list_concat(head, tail->nd_next);
}
else {
nd_set_type(tail, NODE_ARRAY);
GC_WB(&tail->nd_head, NEW_STR(tail->nd_lit));
Expand Down

0 comments on commit 71770e5

Please sign in to comment.