mirror of
https://github.com/zed-industries/zed.git
synced 2026-06-01 03:14:56 +07:00
language: Avoid cloning of the previous tree_sitter::Tree (#48197)
The parsing text function used the old tree only as a ref so it doesn't make sense to clone it. Release Notes: - N/A
This commit is contained in:
parent
174fc51152
commit
c06847e48e
1 changed files with 3 additions and 3 deletions
|
|
@ -702,7 +702,7 @@ impl SyntaxSnapshot {
|
|||
text.as_rope(),
|
||||
step_start_byte,
|
||||
&included_ranges,
|
||||
Some(old_tree.clone()),
|
||||
Some(old_tree),
|
||||
budget,
|
||||
);
|
||||
match result {
|
||||
|
|
@ -1450,7 +1450,7 @@ fn parse_text(
|
|||
text: &Rope,
|
||||
start_byte: usize,
|
||||
ranges: &[tree_sitter::Range],
|
||||
old_tree: Option<tree_sitter::Tree>,
|
||||
old_tree: Option<&tree_sitter::Tree>,
|
||||
parse_budget: &mut Option<Duration>,
|
||||
) -> anyhow::Result<tree_sitter::Tree> {
|
||||
with_parser(|parser| {
|
||||
|
|
@ -1478,7 +1478,7 @@ fn parse_text(
|
|||
chunks.seek(start_byte + offset);
|
||||
chunks.next().unwrap_or("").as_bytes()
|
||||
},
|
||||
old_tree.as_ref(),
|
||||
old_tree,
|
||||
progress_callback
|
||||
.as_mut()
|
||||
.map(|progress_callback| tree_sitter::ParseOptions {
|
||||
|
|
|
|||
Loading…
Reference in a new issue