mirror of
https://github.com/rust-lang/rust.git
synced 2025-02-27 06:14:55 +00:00
Fix potential overflow
This commit is contained in:
parent
53787c7eba
commit
3c1714d76d
@ -188,8 +188,8 @@ impl Patchwork {
|
||||
.fold((0usize, 0usize), |(x1, y1), (x2, y2)| (x1 + x2, y1 + y2));
|
||||
|
||||
for pos in &mut [&mut range.start, &mut range.end] {
|
||||
**pos -= delete;
|
||||
**pos += insert;
|
||||
**pos -= delete
|
||||
}
|
||||
|
||||
self.text.replace_range(range, &patch);
|
||||
|
Loading…
Reference in New Issue
Block a user