]> git.lizzy.rs Git - rust.git/commitdiff
Optimize string handling in lit_token().
authorNicholas Nethercote <nnethercote@mozilla.com>
Fri, 4 May 2018 06:53:31 +0000 (16:53 +1000)
committerNicholas Nethercote <nnethercote@mozilla.com>
Tue, 8 May 2018 23:17:03 +0000 (09:17 +1000)
In the common case, the string value in a string literal Token is the
same as the string value in a string literal LitKind. (The exception is
when escapes or \r are involved.) This patch takes advantage of that to
avoid calling str_lit() and re-interning the string in that case. This
speeds up incremental builds for a few of the rustc-benchmarks, the best
by 3%.


No differences found