Skip to content

Commit

Permalink
Removed useless string allocs from the XML parser.
Browse files Browse the repository at this point in the history
  • Loading branch information
Yorick Peterse committed Mar 21, 2015
1 parent fdcd712 commit a5cd75c
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions lib/oga/xml/parser.rll
Original file line number Diff line number Diff line change
Expand Up @@ -212,12 +212,18 @@ string_squote_follow
;

string_body
= T_STRING_BODY string_body_follow { val[0] + val[1] }
= T_STRING_BODY string_body_follow
{
val[1] ? val[0] + val[1] : val[0]
}
;

string_body_follow
= T_STRING_BODY string_body_follow { val[0] + val[1] }
| _ { '' }
= T_STRING_BODY string_body_follow
{
val[1] ? val[0] + val[1] : val[0]
}
| _ { nil }
;

%inner
Expand Down

0 comments on commit a5cd75c

Please sign in to comment.