mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 04:44:57 +00:00
internal: Optimize apply_document_changes
a bit
This commit is contained in:
parent
cd2603299c
commit
e468a1af35
3 changed files with 68 additions and 56 deletions
|
@ -58,8 +58,11 @@ impl LineIndex {
|
|||
let mut utf16_lines = NoHashHashMap::default();
|
||||
let mut utf16_chars = Vec::new();
|
||||
|
||||
let mut newlines = vec![0.into()];
|
||||
let mut curr_row @ mut curr_col = 0.into();
|
||||
let mut newlines = Vec::with_capacity(16);
|
||||
newlines.push(TextSize::from(0));
|
||||
|
||||
let mut curr_row = 0.into();
|
||||
let mut curr_col = 0.into();
|
||||
let mut line = 0;
|
||||
for c in text.chars() {
|
||||
let c_len = TextSize::of(c);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue