Skip to content

Commit

Permalink
Avoid an unnecessary clone in generic_extensions.
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 a935481 commit e382267
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/libsyntax/ext/tt/macro_rules.rs
Expand Up @@ -139,9 +139,9 @@ fn generic_extension<'cx>(cx: &'cx ExtCtxt,
macro_ident: name
})
}
Failure(sp, ref msg) => if sp.lo >= best_fail_spot.lo {
Failure(sp, msg) => if sp.lo >= best_fail_spot.lo {
best_fail_spot = sp;
best_fail_msg = (*msg).clone();
best_fail_msg = msg;
},
Error(err_sp, ref msg) => {
cx.span_fatal(err_sp.substitute_dummy(sp), &msg[..])
Expand Down

0 comments on commit e382267

Please sign in to comment.