Avoid an unnecessary clone in macro_parser::parse.

This avoids ~800,000 allocations in html5ever.
This commit is contained in:
Nicholas Nethercote 2016-10-21 10:31:53 +11:00
parent 0c429872a3
commit a935481ae9

View File

@ -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);
}