Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

gpui: Pre-allocate paths in open file dialog (#32106)

tidely9775747ba91c
diff --git a/crates/gpui/src/platform/windows/platform.rs b/crates/gpui/src/platform/windows/platform.rs
index 1fbbd7b7821..98defb44ee3 100644
--- a/crates/gpui/src/platform/windows/platform.rs
+++ b/crates/gpui/src/platform/windows/platform.rs
@@ -780,7 +780,7 @@ fn file_open_dialog(options: PathPromptOptions) -> Result<Option<Vec<PathBuf>>>
return Ok(None);
}
- let mut paths = Vec::new();
+ let mut paths = Vec::with_capacity(file_count as usize);
for i in 0..file_count {
let item = unsafe { results.GetItemAt(i)? };
let path = unsafe { item.GetDisplayName(SIGDN_FILESYSPATH)?.to_string()? };