Make SanitizedPath wrap Path instead of Arc<Path> to avoid allocation (#37106)
Release Notes: - N/A
This commit is contained in:
@@ -26,7 +26,7 @@ impl PathList {
|
||||
let mut indexed_paths: Vec<(usize, PathBuf)> = paths
|
||||
.iter()
|
||||
.enumerate()
|
||||
.map(|(ix, path)| (ix, SanitizedPath::from(path).into()))
|
||||
.map(|(ix, path)| (ix, SanitizedPath::new(path).into()))
|
||||
.collect();
|
||||
indexed_paths.sort_by(|(_, a), (_, b)| a.cmp(b));
|
||||
let order = indexed_paths.iter().map(|e| e.0).collect::<Vec<_>>().into();
|
||||
|
||||
@@ -2576,7 +2576,7 @@ impl Workspace {
|
||||
};
|
||||
|
||||
let this = this.clone();
|
||||
let abs_path: Arc<Path> = SanitizedPath::from(abs_path.clone()).into();
|
||||
let abs_path: Arc<Path> = SanitizedPath::new(&abs_path).as_path().into();
|
||||
let fs = fs.clone();
|
||||
let pane = pane.clone();
|
||||
let task = cx.spawn(async move |cx| {
|
||||
|
||||
Reference in New Issue
Block a user