about summary refs log tree commit diff
path: root/compiler/rustc_span/src
diff options
context:
space:
mode:
authorNicholas Nethercote <n.nethercote@gmail.com>2023-06-28 08:14:29 +1000
committerNicholas Nethercote <n.nethercote@gmail.com>2023-06-29 11:26:39 +1000
commita13be655a511c215cc4d1d120d981bfe80b04eec (patch)
treeb2c3e5599b5072157106c94976eab2ade6cb7521 /compiler/rustc_span/src
parent8084f397c6710e4748994dd1488b1f399283d469 (diff)
downloadrust-a13be655a511c215cc4d1d120d981bfe80b04eec.tar.gz
rust-a13be655a511c215cc4d1d120d981bfe80b04eec.zip
Avoid unnecessary line lookup.
`lookup_debug_loc` calls `SourceMap::lookup_line`, which does a binary
search over the files, and then a binary search over the lines within
the found file. It then calls `SourceFile::line_begin_pos`, which redoes
the binary search over the lines within the found file.

This commit removes the second binary search over the lines, instead
getting the line starting pos directly using the result of the first
binary search over the lines.

(And likewise for `get_span_loc`, in the cranelift backend.)
Diffstat (limited to 'compiler/rustc_span/src')
0 files changed, 0 insertions, 0 deletions