1
Fork 0

Address review comments.

This commit is contained in:
Nicholas Nethercote 2022-06-02 11:43:14 +10:00
parent 0b81d7cdc6
commit 72de7c4102
3 changed files with 70 additions and 51 deletions

View file

@ -356,12 +356,12 @@ impl SourceMap {
// compiler backend can optimize away the repeated computations in a
// way that won't trigger overflow checks.
match &mut *file_local_lines.borrow_mut() {
SourceFileLines::Lines { lines } => {
SourceFileLines::Lines(lines) => {
for pos in lines {
*pos = (*pos - original_start_pos) + start_pos;
}
}
SourceFileLines::Diffs { line_start, .. } => {
SourceFileLines::Diffs(SourceFileDiffs { line_start, .. }) => {
*line_start = (*line_start - original_start_pos) + start_pos;
}
}