mirror of
https://github.com/rust-lang/rust-analyzer
synced 2024-12-27 05:23:24 +00:00
Fix potential overflow
This commit is contained in:
parent
53787c7eba
commit
3c1714d76d
1 changed files with 1 additions and 1 deletions
|
@ -188,8 +188,8 @@ impl Patchwork {
|
||||||
.fold((0usize, 0usize), |(x1, y1), (x2, y2)| (x1 + x2, y1 + y2));
|
.fold((0usize, 0usize), |(x1, y1), (x2, y2)| (x1 + x2, y1 + y2));
|
||||||
|
|
||||||
for pos in &mut [&mut range.start, &mut range.end] {
|
for pos in &mut [&mut range.start, &mut range.end] {
|
||||||
|
**pos -= delete;
|
||||||
**pos += insert;
|
**pos += insert;
|
||||||
**pos -= delete
|
|
||||||
}
|
}
|
||||||
|
|
||||||
self.text.replace_range(range, &patch);
|
self.text.replace_range(range, &patch);
|
||||||
|
|
Loading…
Reference in a new issue