Make SanitizedPath wrap Path instead of Arc<Path> to avoid allocation (#37106)
Release Notes: - N/A
This commit is contained in:
@@ -62,7 +62,7 @@ use std::{
|
||||
};
|
||||
use sum_tree::{Edit, SumTree, TreeSet};
|
||||
use text::{Bias, BufferId};
|
||||
use util::{ResultExt, debug_panic, post_inc};
|
||||
use util::{ResultExt, debug_panic, paths::SanitizedPath, post_inc};
|
||||
use worktree::{
|
||||
File, PathChange, PathKey, PathProgress, PathSummary, PathTarget, ProjectEntryId,
|
||||
UpdatedGitRepositoriesSet, UpdatedGitRepository, Worktree,
|
||||
@@ -3234,6 +3234,7 @@ impl Repository {
|
||||
let git_store = self.git_store.upgrade()?;
|
||||
let worktree_store = git_store.read(cx).worktree_store.read(cx);
|
||||
let abs_path = self.snapshot.work_directory_abs_path.join(&path.0);
|
||||
let abs_path = SanitizedPath::new(&abs_path);
|
||||
let (worktree, relative_path) = worktree_store.find_worktree(abs_path, cx)?;
|
||||
Some(ProjectPath {
|
||||
worktree_id: worktree.read(cx).id(),
|
||||
|
||||
Reference in New Issue
Block a user