Skip to content

Commit

Permalink
Avoid an unnecessary clone in macro_parser::parse.
Browse files Browse the repository at this point in the history
This avoids ~800,000 allocations in html5ever.
  • Loading branch information
nnethercote committed Oct 21, 2016
1 parent 0c42987 commit a935481
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/libsyntax/ext/tt/macro_parser.rs
Expand Up @@ -425,8 +425,8 @@ pub fn parse(sess: &ParseSess,
cur_eis.push(ei);
}
TokenTree::Token(_, ref t) => {
let mut ei_t = ei.clone();
if token_name_eq(t,&tok) {
let mut ei_t = ei.clone();
ei_t.idx += 1;
next_eis.push(ei_t);
}
Expand Down

0 comments on commit a935481

Please sign in to comment.