about summary refs log tree commit diff
path: root/compiler/rustc_codegen_llvm/src/llvm/mod.rs
diff options
context:
space:
mode:
authorNicholas Nethercote <n.nethercote@gmail.com>2022-02-24 16:10:36 +1100
committerNicholas Nethercote <n.nethercote@gmail.com>2022-02-24 17:01:01 +1100
commit37d9ea745b358a5b9f48560600841fc6619e545d (patch)
tree67197e18b9807b94a12ae26be99f197c94e88b78 /compiler/rustc_codegen_llvm/src/llvm/mod.rs
parent532d3cda90b8a729cd982548649d32803d265052 (diff)
downloadrust-37d9ea745b358a5b9f48560600841fc6619e545d.tar.gz
rust-37d9ea745b358a5b9f48560600841fc6619e545d.zip
Improve `scan_escape`.
`scan_escape` currently has a fast path (for when the first char isn't
'\\') and a slow path.

This commit changes `scan_escape` so it only handles the slow path, i.e.
the actual escaping code. The fast path is inlined into the two call
sites.

This change makes the code faster, because there is no function call
overhead on the fast path. (`scan_escape` is a big function and doesn't
get inlined.)

This change also improves readability, because it removes a bunch of
mode checks on the the fast paths.
Diffstat (limited to 'compiler/rustc_codegen_llvm/src/llvm/mod.rs')
0 files changed, 0 insertions, 0 deletions